mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
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:
@@ -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 ###
|
||||
|
||||
Reference in New Issue
Block a user