summaryrefslogtreecommitdiff
path: root/tools/frr-reload.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/frr-reload.py')
-rwxr-xr-xtools/frr-reload.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 8ffc313c04..88873da904 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -128,17 +128,13 @@ class Vtysh(object):
% (child.returncode))
def mark_file(self, filename, stdin=None):
- kwargs = {}
- if stdin is not None:
- kwargs['stdin'] = stdin
-
child = self._call(['-m', '-f', filename],
- stdout=subprocess.PIPE, **kwargs)
+ stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.PIPE)
try:
stdout, stderr = child.communicate()
except subprocess.TimeoutExpired:
child.kill()
- stdout, stderr = proc.communicate()
+ stdout, stderr = child.communicate()
raise VtyshException('vtysh call timed out!')
if child.wait() != 0:
@@ -1313,8 +1309,12 @@ if __name__ == '__main__':
# Create a Config object from the config generated by newconf
newconf = Config(vtysh)
- newconf.load_from_file(args.filename)
- reload_ok = True
+ try:
+ newconf.load_from_file(args.filename)
+ reload_ok = True
+ except VtyshException as ve:
+ log.error("vtysh failed to process new configuration: {}".format(ve))
+ reload_ok = False
if args.test: