summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/topotests/lib/topogen.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/topotests/lib/topogen.py b/tests/topotests/lib/topogen.py
index 758ebcf2bf..ad8dd813c2 100644
--- a/tests/topotests/lib/topogen.py
+++ b/tests/topotests/lib/topogen.py
@@ -645,7 +645,11 @@ class TopoRouter(TopoGear):
if isjson is False:
return output
- return json.loads(output)
+ try:
+ return json.loads(output)
+ except ValueError:
+ logger.warning('vtysh_cmd: failed to convert json output')
+ return {}
def vtysh_multicmd(self, commands, pretty_output=True):
"""