datacenter / acitoolkit

A basic toolkit for accessing the Cisco APIC
Other
350 stars 266 forks source link

acisession login error handling #319

Closed jeremyrichardmann closed 6 years ago

jeremyrichardmann commented 6 years ago

When logging in with an invalid password, the acisession login routine doesn't handle the exception gracefully.

An error is logged, however an attempt is made to start the login thread daemon which errors out and a response object is never returned to the user.

Seems like returning from the caught ConnectionError exception would stop this.

Here is the error returned:

t = s.login() ERROR:root:Could not relogin to APIC. Aborting login thread. Traceback (most recent call last): File "", line 1, in File "acisession.py", line 675, in login self.login_thread.daemon = True File "\Python36\lib\threading.py", line 1141, in daemon raise RuntimeError("cannot set daemon status of active thread") RuntimeError: cannot set daemon status of active thread

jeremyrichardmann commented 6 years ago

Looks like this was fixed with the most recent commit.