mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 07:37:54 +00:00
Merge pull request #7125 from qlyoung/what-the-frick-robert
tools: fix vtysh failure error handling
This commit is contained in:
commit
b0164b18eb
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user