- if ip_format not in ('ip4', 'ip6'):
- raise ValueError("Ip not in correct format!")
- ip4 = ip6 = 0
- if ip_format == 'ip4':
- ip4 = 1
- else:
- ip6 = 1
- sw_if_index = Topology.get_interface_sw_index(node, interface)
- cmd = 'cop_whitelist_enable_disable'
- err_msg = 'Failed to add COP whitelist on ifc {ifc}'\
- .format(ifc=interface)
- args_in = dict(
- sw_if_index=int(sw_if_index),
+ if ip_version not in (u"ip4", u"ip6"):
+ raise ValueError(u"IP version is not in correct format")
+
+ cmd = u"cop_whitelist_enable_disable"
+ err_msg = f"Failed to add COP whitelist on interface {interface} " \
+ f"on host {node[u'host']}"
+ args = dict(
+ sw_if_index=Topology.get_interface_sw_index(node, interface),