From 28dae306c8378619506e8a1c6f7dac983ca1dcca Mon Sep 17 00:00:00 2001 From: Hugo Rosario Date: Wed, 21 Feb 2024 15:18:21 +0000 Subject: [PATCH] Retry connection without plain text authentication --- mktxp/flow/router_connection.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mktxp/flow/router_connection.py b/mktxp/flow/router_connection.py index 2a0b6ba0..40ae7343 100644 --- a/mktxp/flow/router_connection.py +++ b/mktxp/flow/router_connection.py @@ -78,7 +78,12 @@ def connect(self): return try: print(f'Connecting to router {self.router_name}@{self.config_entry.hostname}') - self.api = self.connection.get_api() + try: + self.api = self.connection.get_api() + except: + self.connection.plaintext_login = False + self.api = self.connection.get_api() + self._set_connect_state(success = True, connect_time = connect_time) except (socket.error, socket.timeout, Exception) as exc: self._set_connect_state(success = False, connect_time = connect_time, exc = exc)