tools: fix frr-reload.py daemon option

the refactored frr-reload.py is adding 'no-header' to the
'show running' command of vtysh, but if a daemon is specified
the no-header option should only be added after the daemon name.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
Emanuele Di Pascale 2020-06-15 14:44:05 +02:00
parent 1a5fc72066
commit 7e7fedcb40

View File

@ -146,9 +146,10 @@ class Vtysh(object):
return stdout.decode('UTF-8') return stdout.decode('UTF-8')
def mark_show_run(self, daemon = None): def mark_show_run(self, daemon = None):
cmd = 'show running-config no-header' cmd = 'show running-config'
if daemon: if daemon:
cmd += ' %s' % daemon cmd += ' %s' % daemon
cmd += ' no-header'
show_run = self._call_cmd(cmd, stdout=subprocess.PIPE) show_run = self._call_cmd(cmd, stdout=subprocess.PIPE)
mark = self._call(['-m', '-f', '-'], stdin=show_run.stdout, stdout=subprocess.PIPE) mark = self._call(['-m', '-f', '-'], stdin=show_run.stdout, stdout=subprocess.PIPE)