- cmd1 = 'bridge_domain_add_del'
- args1 = dict(bd_id=int(bd_id),
- flood=1,
- uu_flood=1,
- forward=1,
- learn=learn_int,
- arp_term=0,
- is_add=1)
-
- cmd2 = 'sw_interface_set_l2_bridge'
- args2 = dict(rx_sw_if_index=sw_if_index1,
- bd_id=int(bd_id),
- shg=0,
- port_type=0,
- enable=1)
-
- args3 = dict(rx_sw_if_index=sw_if_index2,
- bd_id=int(bd_id),
- shg=0,
- port_type=0,
- enable=1)
-
- err_msg = 'Failed to add L2 bridge domain with 2 interfaces on host' \
- ' {host}'.format(host=node['host'])
-
- with PapiExecutor(node) as papi_exec:
- papi_exec.add(cmd1, **args1).add(cmd2, **args2).add(cmd2, **args3).\
- get_replies(err_msg).verify_replies(err_msg=err_msg)
+ cmd1 = u"bridge_domain_add_del"
+ args1 = dict(
+ bd_id=int(bd_id),
+ flood=1,
+ uu_flood=1,
+ forward=1,
+ learn=learn_int,
+ arp_term=0,
+ is_add=1
+ )
+
+ cmd2 = u"sw_interface_set_l2_bridge"
+ args2 = dict(
+ rx_sw_if_index=sw_if_index1,
+ bd_id=int(bd_id),
+ shg=0,
+ port_type=0,
+ enable=1
+ )
+
+ args3 = dict(
+ rx_sw_if_index=sw_if_index2,
+ bd_id=int(bd_id),
+ shg=0,
+ port_type=0,
+ enable=1
+ )
+
+ err_msg = f"Failed to add L2 bridge domain with 2 interfaces " \
+ f"on host {node[u'host']}"
+
+ with PapiSocketExecutor(node) as papi_exec:
+ papi_exec.add(cmd1, **args1).add(cmd2, **args2).add(cmd2, **args3)
+ papi_exec.get_replies(err_msg)