FIX: use int of sw_if_index in call of sw_interface_set_flags api 18/22518/2
authorJan Gelety <jgelety@cisco.com>
Thu, 3 Oct 2019 17:42:34 +0000 (19:42 +0200)
committerJan Gelety <jgelety@cisco.com>
Fri, 4 Oct 2019 09:27:51 +0000 (09:27 +0000)
- it will avoid situation that corresponding port is not up and
  its sw_if_index value in topology file is None that is interpreted
  as 0 in vpp api so it set flag for local0 interface

Change-Id: I9145077d787ddde50a29bcd4091035e95077f946
Signed-off-by: Jan Gelety <jgelety@cisco.com>
resources/libraries/python/InterfaceUtil.py

index b25e70b..1d1d669 100644 (file)
@@ -193,7 +193,7 @@ class InterfaceUtil(object):
             err_msg = 'Failed to set interface state on host {host}'.format(
                 host=node['host'])
             args = dict(
-                sw_if_index=sw_if_index,
+                sw_if_index=int(sw_if_index),
                 flags=flags)
             with PapiSocketExecutor(node) as papi_exec:
                 papi_exec.add(cmd, **args).get_reply(err_msg)