minor update to catch expection if trying close a non existent session
This will prevent the junos shared module from throwing an exception if the session is trying to be closed when it doesn't exist
This commit is contained in:
parent
686d79a515
commit
1dac6edbe4
1 changed files with 3 additions and 1 deletions
|
@ -105,8 +105,10 @@ class Netconf(object):
|
|||
self._connected = True
|
||||
|
||||
def disconnect(self):
|
||||
if self.device:
|
||||
try:
|
||||
self.device.close()
|
||||
except AttributeError:
|
||||
pass
|
||||
self._connected = False
|
||||
|
||||
### Command methods ###
|
||||
|
|
Loading…
Reference in a new issue