CSIT-1460: Add VPP-stats to PAPI Provider
[csit.git] / resources / libraries / python / InterfaceUtil.py
index 939d808..a1a9b73 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Cisco and/or its affiliates.
+# Copyright (c) 2019 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -1644,8 +1644,9 @@ class InterfaceUtil(object):
             cmd=cmd, host=node['host'])
         with PapiExecutor(node) as papi_exec:
             for ifc in node['interfaces'].values():
-                papi_exec.add(cmd, sw_if_index=ifc['vpp_sw_index'])
-            papi_resp = papi_exec.execute_should_pass(err_msg)
+                if ifc['vpp_sw_index'] is not None:
+                    papi_exec.add(cmd, sw_if_index=ifc['vpp_sw_index'])
+            papi_resp = papi_exec.get_dump(err_msg)
         thr_mapping = [s[cmd_reply] for r in papi_resp.reply
                        for s in r['api_reply']]
         return sorted(thr_mapping, key=lambda k: k['sw_if_index'])