diff options
author | Peter Sprygada <privateip@users.noreply.github.com> | 2016-09-09 10:42:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-09 10:42:05 -0400 |
commit | 19e00cf160b98a392d4ba0e9288b09fbb349b1cf (patch) | |
tree | c69918cce6eeaaac83ee7fda95cc2e66f3b8e279 | |
parent | cd2f60e11abf3690a0b265400e77b8c4237603b4 (diff) | |
parent | 1dac6edbe4281a3d91087d0986a1458dc542b9c7 (diff) | |
download | ansible-19e00cf160b98a392d4ba0e9288b09fbb349b1cf.tar.gz |
Merge pull request #17481 from privateip/junos
minor update to catch expection if trying close a non existent session
-rw-r--r-- | lib/ansible/module_utils/junos.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/junos.py b/lib/ansible/module_utils/junos.py index 786e415c48..16f2057866 100644 --- a/lib/ansible/module_utils/junos.py +++ b/lib/ansible/module_utils/junos.py @@ -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 ### |