diff --git a/pyntc/devices/ios_device.py b/pyntc/devices/ios_device.py index c5c78e22..cecec7fd 100644 --- a/pyntc/devices/ios_device.py +++ b/pyntc/devices/ios_device.py @@ -841,6 +841,8 @@ def peer_redundancy_state(self): log.error("Host %s: Command error for command 'show redundancy'.", self.host) return None re_show_redundancy = RE_SHOW_REDUNDANCY.match(show_redundancy.lstrip()) + if not re_show_redundancy: + return None processor_redundancy_info = re_show_redundancy.group("other") if processor_redundancy_info is not None: re_redundancy_state = RE_REDUNDANCY_STATE.search(processor_redundancy_info) @@ -905,6 +907,8 @@ def redundancy_mode(self): log.error("Host %s: Command error for command 'show redundancy'.", self.host) return "n/a" re_show_redundancy = RE_SHOW_REDUNDANCY.match(show_redundancy.lstrip()) + if not re_show_redundancy: + return None redundancy_info = re_show_redundancy.group("info") re_redundancy_mode = RE_REDUNDANCY_OPERATION_MODE.search(redundancy_info) redundancy_mode = re_redundancy_mode.group(1).lower() @@ -932,6 +936,8 @@ def redundancy_state(self): log.error("Host %s: Command error for command 'show redundancy'.", self.host) return None re_show_redundancy = RE_SHOW_REDUNDANCY.match(show_redundancy.lstrip()) + if not re_show_redundancy: + return None processor_redundancy_info = re_show_redundancy.group("self") re_redundancy_state = RE_REDUNDANCY_STATE.search(processor_redundancy_info) processor_redundancy_state = re_redundancy_state.group(1).lower()