From 15002ec2f7793822a5ca7913bcd616752cf2fcc1 Mon Sep 17 00:00:00 2001 From: Mircea Ulinic Date: Fri, 12 Jan 2018 16:00:31 +0000 Subject: [PATCH] IOS-XR: return the is_alive flag for the SSH channel As a temporary fix for #579 --- napalm/iosxr/iosxr.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/napalm/iosxr/iosxr.py b/napalm/iosxr/iosxr.py index fb1530fd3..44f717b6c 100644 --- a/napalm/iosxr/iosxr.py +++ b/napalm/iosxr/iosxr.py @@ -106,10 +106,10 @@ def close(self): def is_alive(self): """Returns a flag with the state of the connection.""" - # Simply returns the flag from Netmiko - return { - 'is_alive': self.device.device.is_alive() - } + if self.device is None: + return {'is_alive': False} + # Simply returns the flag from pyIOSXR + return {'is_alive': self.device.is_alive()} def load_replace_candidate(self, filename=None, config=None): self.pending_changes = True