Skip to content

Commit 408869b

Browse files
committed
Closes #1
Adjusted server handling, should correct jamfcloud issue.
1 parent 51f7df2 commit 408869b

File tree

3 files changed

+19
-6
lines changed

3 files changed

+19
-6
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ The user password is minimally obfuscated. Pull requests offering additional saf
184184

185185
## Update History
186186

187-
| Date | Notes |
188-
| ---------- | ---------------- |
189-
| 2019.07.16 | Initial release. |
187+
| Date | Version | Notes |
188+
| ---------- | ------- | ----------------------------- |
189+
| 2019.07.16 | 1.0 | Initial release. |
190+
| 2019.07.22 | 1.0.1 | Adjusted server url handling. |

jss_login.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#
2525
# 1.1.0 2019.07.16 Initial version. tjm
2626
#
27+
# 1.1.1 2019.07.22 Adjusted server url handling. tjm
28+
#
2729
#
2830
################################################################################
2931

@@ -82,11 +84,21 @@ def __init__(self, logger, args):
8284

8385
# self.display_config()
8486

85-
if "https" and "8443" not in self.config_file.get('login', 'hosts'):
86-
self.config_file.set('login', 'hosts', "https://" + self.config_file.get('login', 'hosts') + ":8443")
87+
working_server_name = self.config_file.get('login', 'hosts')
88+
89+
if "https" not in working_server_name:
90+
if "http" in working_server_name:
91+
working_server_name.replace("http", "https")
92+
else:
93+
working_server_name = "https://" + working_server_name
94+
95+
if "jamfcloud" and "8443" not in working_server_name:
96+
working_server_name = working_server_name + ":8443"
97+
98+
self.config_file.set('login', 'hosts', working_server_name)
8799

88100
#
89-
# This is really important. This list contains the required rights for the fields we need to access
101+
# THIS IS REALLY IMPORTANT. This list contains the required rights for the fields we need to access
90102
# Could be moved to configuration file, if appropriate.
91103
self.read_privileges = ['Read Computers', 'Read LDAP Servers', 'Read Accounts', 'Read User']
92104
self.update_privileges = ['Update Computers', 'Update User']
5.92 MB
Binary file not shown.

0 commit comments

Comments
 (0)