diff --git a/fortiosapi/fortiosapi.py b/fortiosapi/fortiosapi.py index 630078e..9e3683b 100644 --- a/fortiosapi/fortiosapi.py +++ b/fortiosapi/fortiosapi.py @@ -193,7 +193,6 @@ def tokenlogin(self, host, apitoken, verify=True, cert=None, timeout=12, vdom="g self._session = requests.session() # may happen at start or if logout is called self._session.headers.update({'Authorization': 'Bearer ' + apitoken}) - self._logged = True LOG.debug("self._https is %s", self._https) if not self._https: self.url_prefix = 'http://' + self.host @@ -211,6 +210,7 @@ def tokenlogin(self, host, apitoken, verify=True, cert=None, timeout=12, vdom="g resp_lic = self.get('system', 'status', vdom=vdom) LOG.debug("response system/status : %s", resp_lic) self._fortiversion = resp_lic['version'] + self._logged = True return True def get_version(self):