summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/lib/topogen.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py
index f5b3ad06d9..d505317e4e 100644
--- a/tests/topotests/lib/topogen.py
+++ b/tests/topotests/lib/topogen.py
@@ -33,6 +33,7 @@ import os
import platform
import pwd
import re
+import shlex
import subprocess
import sys
from collections import OrderedDict
@@ -946,9 +947,11 @@ class TopoRouter(TopoGear):
if daemon is not None:
dparam += "-d {}".format(daemon)
- vtysh_command = 'vtysh {} -c "{}" 2>/dev/null'.format(dparam, command)
+ vtysh_command = "vtysh {} -c {} 2>/dev/null".format(
+ dparam, shlex.quote(command)
+ )
- self.logger.debug('vtysh command => "{}"'.format(command))
+ self.logger.debug("vtysh command => {}".format(shlex.quote(command)))
output = self.run(vtysh_command)
dbgout = output.strip()