]> git.proxmox.com Git - mirror_frr.git/commitdiff
tests: [Topojson] Enhance CLI logging
authorKuldeep Kashyap <kashyapk@vmware.com>
Mon, 23 May 2022 23:52:16 +0000 (16:52 -0700)
committerKuldeep Kashyap <kashyapk@vmware.com>
Tue, 24 May 2022 06:34:19 +0000 (23:34 -0700)
As of now we are logging only JSON output of CLIs
in topotests(topojson) executions and same o/p is
getting printed twice, which is of no use.

Enhanced code to show both plain and JSON output
of CLIs and remove duplicate logging.

It will help in reducing execution logs and in
verification, if sometimes there is mis-match
in CLI plain and JSON outputs.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
tests/topotests/lib/common_config.py

index 3f70dbddf7883f74597f60684ff90ebac5245d12..a7d8b2c9b577b6c9fcbefbfa12ebb08c6ed359bc 100644 (file)
@@ -225,17 +225,9 @@ def run_frr_cmd(rnode, cmd, isjson=False):
     if cmd:
         ret_data = rnode.vtysh_cmd(cmd, isjson=isjson)
 
-        if True:
-            if isjson:
-                print_data = json.dumps(ret_data)
-            else:
-                print_data = ret_data
-            logger.info(
-                "Output for command [%s] on router %s:\n%s",
-                cmd,
-                rnode.name,
-                print_data,
-            )
+        if isjson:
+            rnode.vtysh_cmd(cmd.rstrip("json"), isjson=False)
+
         return ret_data
 
     else: