From 2dc5924d35671c01e9aaa4ea6b9ae18bdd184ca8 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Wed, 20 Mar 2019 13:15:40 +0100 Subject: CSIT-1460: Add VPP-stats to PAPI Provider Change-Id: I2665700a4948c481585d66c987f94af748f102c3 Signed-off-by: Tibor Frank --- resources/libraries/python/InterfaceUtil.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'resources/libraries/python/InterfaceUtil.py') 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']) -- cgit 1.2.3-korg