mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #17481 from privateip/junos
minor update to catch expection if trying close a non existent session
This commit is contained in:
commit
19e00cf160
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