Closed ktbyers closed 7 years ago
@mirceaulinic FYI, I made a minor change to is_alive
here. Basically check that self.device is not set to None (i.e. there is an active connection). I was some seeing some testing exceptions otherwise.
i.e. things like self.device.send_command(null)
would be called when self.device
was None.
@itdependsnetworks FYI, can you review this.
I did manually test the exception handling to make sure it worked properly on PY2 and PY3. I also tested a merge against a real device both using autodetect and with passing in the file system as an optional argument.
Pulled your branch and looks good to me.
Okay, I will let @mirceaulinic have a chance to comment on the is_alive
change and then should be good to go.
Thanks @ktbyers, looks good.
Just as an aside, I would have caught AttibuteError
and return the same {'is_alive': False}
(apparently try-catch tends to be faster than if-else, in particular when the try block already exists). But that's just an insignificant detail, don't know actually why I put it here... but I will submit this anyway :-)