From 7d3f172e0d904943fabaed88a2482efe8d60deb6 Mon Sep 17 00:00:00 2001 From: Jonathan Nightingale Date: Tue, 22 Jan 2019 03:29:01 -0800 Subject: [PATCH] The problem comes when .if commit_error_dialog_dict is not None and alt_error_marker in commit_error_dialog_dict. case is hit, but then .if alt_error_marker in output:. is not hit . in the case where there was a commit error which is not the 'One or more commits have occurred from other' error. If this path is hit, there is no .else. case, so no output is returned and also no exception raised . i.e. there.s no way to tell anything about the commit result. --- netmiko/cisco/cisco_xr.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netmiko/cisco/cisco_xr.py b/netmiko/cisco/cisco_xr.py index 45c226c2b..1882d04de 100644 --- a/netmiko/cisco/cisco_xr.py +++ b/netmiko/cisco/cisco_xr.py @@ -200,6 +200,8 @@ def commit(self, confirm=False, confirm_delay=None, comment='', label='', output += self.send_command_timing(marker_value, strip_prompt=False, strip_command=False, delay_factor=delay_factor) return output + else: + raise err elif alt_error_marker in output: # Other commits occurred, don't proceed with commit output += self.send_command_timing("no", strip_prompt=False, strip_command=False,