diff options
Diffstat (limited to 'test/lib/quagga.py')
-rw-r--r-- | test/lib/quagga.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/test/lib/quagga.py b/test/lib/quagga.py index ce53a29b..4dd42d76 100644 --- a/test/lib/quagga.py +++ b/test/lib/quagga.py @@ -228,10 +228,13 @@ class QuaggaBGPContainer(BGPContainer): f.writelines(str(c)) def vtysh(self, cmd, config=True): + if type(cmd) is not list: + cmd = [cmd] + cmd = ' '.join("-c '{0}'".format(c) for c in cmd) if config: - return self.local("vtysh -d bgpd -c 'en' -c 'conf t' -c 'router bgp {0}' -c '{1}'".format(self.asn, cmd), capture=True) + return self.local("vtysh -d bgpd -c 'en' -c 'conf t' -c 'router bgp {0}' {1}".format(self.asn, cmd), capture=True) else: - return self.local("vtysh -d bgpd -c '{0}'".format(cmd), capture=True) + return self.local("vtysh -d bgpd {0}".format(cmd), capture=True) def reload_config(self): daemon = [] |