]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: frr-reload.py VtyshMarkException needs to include "vtysh -m"
authorDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 17 May 2017 00:23:38 +0000 (00:23 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Wed, 17 May 2017 00:23:38 +0000 (00:23 +0000)
output

Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
tools/frr-reload.py

index 090937ed2704301a913ef69a6862326b3eb5eb1d..11e0bdc681ff7f8e5284e250a2625e69c45b971d 100755 (executable)
@@ -109,9 +109,12 @@ class Config(object):
         log.info('Loading Config object from file %s', filename)
 
         try:
-            file_output = subprocess.check_output(['/usr/bin/vtysh', '-m', '-f', filename])
+            file_output = subprocess.check_output(['/usr/bin/vtysh', '-m', '-f', filename],
+                                                  stderr=subprocess.STDOUT)
         except subprocess.CalledProcessError as e:
-            raise VtyshMarkException(str(e))
+            ve = VtyshMarkException(e)
+            ve.output = e.output
+            raise ve
 
         for line in file_output.split('\n'):
             line = line.strip()
@@ -134,9 +137,11 @@ class Config(object):
         try:
             config_text = subprocess.check_output(
                 "/usr/bin/vtysh -c 'show run' | /usr/bin/tail -n +4 | /usr/bin/vtysh -m -f -",
-                shell=True)
+                shell=True, stderr=subprocess.STDOUT)
         except subprocess.CalledProcessError as e:
-            raise VtyshMarkException(str(e))
+            ve = VtyshMarkException(e)
+            ve.output = e.output
+            raise ve
 
         for line in config_text.split('\n'):
             line = line.strip()