summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-09-09 10:42:05 -0400
committerGitHub <noreply@github.com>2016-09-09 10:42:05 -0400
commit19e00cf160b98a392d4ba0e9288b09fbb349b1cf (patch)
treec69918cce6eeaaac83ee7fda95cc2e66f3b8e279
parentcd2f60e11abf3690a0b265400e77b8c4237603b4 (diff)
parent1dac6edbe4281a3d91087d0986a1458dc542b9c7 (diff)
downloadansible-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.py4
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 ###