aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2019-03-20 13:15:40 +0100
committerJan Gelety <jgelety@cisco.com>2019-03-27 14:20:07 +0000
commit2dc5924d35671c01e9aaa4ea6b9ae18bdd184ca8 (patch)
treeb99c7aa0755cd6d364a4081ced6e55ab23c5c664 /resources/libraries/python/InterfaceUtil.py
parentb2e7c9da19663e50873bb6e07daba2aca7e27315 (diff)
CSIT-1460: Add VPP-stats to PAPI Provider
Change-Id: I2665700a4948c481585d66c987f94af748f102c3 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 939d8083dc..a1a9b739e0 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -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'])