aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPUtil.py
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-11-30 17:18:01 +0100
committerJan Gelety <jgelety@cisco.com>2019-12-11 11:27:29 +0000
commit46224ef45ad749e100c591a63c89dc59a94528aa (patch)
treeacf61038f60e8f88cb6970c861196272777c3081 /resources/libraries/python/IPUtil.py
parent53f3ee868ef4dbd2ab41a6fdf0a7255a370f9678 (diff)
CSIT-1597 API cleanup: tap
- cover API changes in VPP: https://gerrit.fd.io/r/c/vpp/+/21706 - cover API cahnges in VPP: https://gerrit.fd.io/r/c/vpp/+/23887 - update vpp stable to version 20.01-rc0~828 Change-Id: I70d88741a02729421d4b31010910138838811518 Signed-off-by: Jan Gelety <jgelety@cisco.com>
Diffstat (limited to 'resources/libraries/python/IPUtil.py')
-rw-r--r--resources/libraries/python/IPUtil.py14
1 files changed, 6 insertions, 8 deletions
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py
index 04961fa45a..c3df1fe376 100644
--- a/resources/libraries/python/IPUtil.py
+++ b/resources/libraries/python/IPUtil.py
@@ -117,12 +117,10 @@ class IPUtil:
if not sw_if_index:
return list()
- is_ipv6 = 1 if ip_version == u"ipv6" else 0
-
cmd = u"ip_address_dump"
args = dict(
sw_if_index=sw_if_index,
- is_ipv6=is_ipv6
+ is_ipv6=bool(ip_version == u"ipv6")
)
err_msg = f"Failed to get L2FIB dump on host {node[u'host']}"
@@ -430,7 +428,7 @@ class IPUtil:
)
cmd = u"ip_neighbor_add_del"
args = dict(
- is_add=1,
+ is_add=True,
neighbor=neighbor
)
err_msg = f"Failed to add IP neighbor on interface {iface_key}"
@@ -607,8 +605,8 @@ class IPUtil:
net_addr = ip_address(network)
cmd = u"ip_route_add_del"
args = dict(
- is_add=1,
- is_multipath=int(kwargs.get(u"multipath", False)),
+ is_add=True,
+ is_multipath=kwargs.get(u"multipath", False),
route=None
)
err_msg = f"Failed to add route(s) on host {node[u'host']}"
@@ -656,11 +654,11 @@ class IPUtil:
cmd = u"ip_table_add_del"
table = dict(
table_id=int(table_id),
- is_ip6=int(ipv6)
+ is_ip6=ipv6
)
args = dict(
table=table,
- is_add=1
+ is_add=True
)
err_msg = f"Failed to add FIB table on host {node[u'host']}"