diff options
author | Jan Gelety <jgelety@cisco.com> | 2019-08-07 21:07:26 +0200 |
---|---|---|
committer | Jan Gelety <jgelety@cisco.com> | 2019-08-20 08:53:04 +0000 |
commit | a46ab8cc305fe9d7e96d321ae8cd0ac7a6fc1e24 (patch) | |
tree | 5cd94586f5f44605b99d4655fa5211dabf9386ad /resources/libraries/python/VPPUtil.py | |
parent | 329e0acee1cf31c6524883e15560993af76f0fad (diff) |
Interface API cleanup
CSIT code alignment with API changes in VPP introduced
by patch https://gerrit.fd.io/r/c/vpp/+/18361
Change-Id: Ib0357bba79f55d297ef1086fbf3b760caca16cdb
Signed-off-by: Jan Gelety <jgelety@cisco.com>
Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/VPPUtil.py')
-rw-r--r-- | resources/libraries/python/VPPUtil.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/resources/libraries/python/VPPUtil.py b/resources/libraries/python/VPPUtil.py index 8b7b6891ac..8f9b593902 100644 --- a/resources/libraries/python/VPPUtil.py +++ b/resources/libraries/python/VPPUtil.py @@ -193,16 +193,25 @@ class VPPUtil(object): """ cmd = 'sw_interface_dump' - args = dict(name_filter_valid=0, name_filter='') + args = dict( + name_filter_valid=False, + name_filter='' + ) err_msg = 'Failed to get interface dump on host {host}'.format( host=node['host']) with PapiSocketExecutor(node) as papi_exec: details = papi_exec.add(cmd, **args).get_details(err_msg) for if_dump in details: - if_dump['interface_name'] = if_dump['interface_name'].rstrip('\x00') - if_dump['tag'] = if_dump['tag'].rstrip('\x00') - if_dump['l2_address'] = L2Util.bin_to_mac(if_dump['l2_address']) + if_dump['l2_address'] = str(if_dump['l2_address']) + if_dump['b_dmac'] = str(if_dump['b_dmac']) + if_dump['b_smac'] = str(if_dump['b_smac']) + if_dump['flags'] = if_dump['flags'].value + if_dump['type'] = if_dump['type'].value + if_dump['link_duplex'] = if_dump['link_duplex'].value + if_dump['sub_if_flags'] = if_dump['sub_if_flags'].value \ + if hasattr(if_dump['sub_if_flags'], 'value') \ + else int(if_dump['sub_if_flags']) # TODO: return only base data logger.trace('Interface data of host {host}:\n{details}'.format( host=node['host'], details=details)) |