diff options
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index b98c001e7d..1461e0f296 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -97,7 +97,7 @@ class Vtysh(object): args = ["-c", command] return self._call(args, stdin, stdout, stderr) - def __call__(self, command): + def __call__(self, command, stdouts=None): """ Call a CLI command (e.g. "show running-config") @@ -107,6 +107,8 @@ class Vtysh(object): proc = self._call_cmd(command, stdout=subprocess.PIPE) stdout, stderr = proc.communicate() if proc.wait() != 0: + if stdouts is not None: + stdouts.append(stdout.decode('UTF-8')) raise VtyshException( 'vtysh returned status %d for command "%s"' % (proc.returncode, command) ) @@ -2006,9 +2008,10 @@ if __name__ == "__main__": # frr(config-if)# no ip ospf authentication # frr(config-if)# + stdouts = [] while True: try: - vtysh(["configure"] + cmd) + vtysh(["configure"] + cmd, stdouts) except VtyshException: @@ -2024,6 +2027,10 @@ if __name__ == "__main__": '"%s" we failed to remove this command', " -- ".join(original_cmd), ) + # Log first error msg for original_cmd + if stdouts: + log.error(stdouts[0]) + reload_ok = False break new_last_arg = last_arg[0:-1] |
