diff --git a/resources/lib/connect/connectionmanager.py b/resources/lib/connect/connectionmanager.py index 999993b5..74daca2d 100644 --- a/resources/lib/connect/connectionmanager.py +++ b/resources/lib/connect/connectionmanager.py @@ -308,7 +308,7 @@ class ConnectionManager(object): return self._resolveFailure() try: - publicInfo = self._tryConnect(address, options) + publicInfo = self._tryConnect(address, options=options) except Exception: return _onFail() else: diff --git a/resources/lib/initialsetup.py b/resources/lib/initialsetup.py index 40cfe3e2..fccdb93c 100644 --- a/resources/lib/initialsetup.py +++ b/resources/lib/initialsetup.py @@ -77,23 +77,25 @@ class InitialSetup(object): ###$ Begin migration $### if settings('server') == "": - current_server = self.user_client.get_server() - if current_server is not None: - server = self.connectmanager.get_server(current_server, - {'ssl': self.user_client.get_ssl()}) - log.info("Detected: %s", server) - try: - server_id = server['Servers'][0]['Id'] - settings('serverId', value=server_id) - except Exception as error: - log.error(error) - log.info("server migration completed") + self.user_client.get_server() + log.info("server migration completed") self.user_client.get_userid() self.user_client.get_token() ###$ End migration $### - if settings('server'): + current_server = self.user_client.get_server() + if current_server and not settings('serverId'): + server = self.connectmanager.get_server(current_server, + {'ssl': self.user_client.get_ssl()}) + log.info("Detected: %s", server) + try: + server_id = server['Servers'][0]['Id'] + settings('serverId', value=server_id) + except Exception as error: + log.error(error) + + if current_server: current_state = self.connectmanager.get_state() try: for server in current_state['Servers']: