- with VatTerminal(node, json_param=False) as vat:
- vat.vat_terminal_exec_cmd_from_template(
- 'memif_create.vat',
- socket=socket, id=mid, role=role)
- if 'sw_if_index' in vat.vat_stdout:
- try:
- sw_if_idx = int(vat.vat_stdout.split()[4])
- if_key = Topology.add_new_port(node, 'memif')
- Topology.update_interface_sw_if_index(
- node, if_key, sw_if_idx)
- ifc_name = Memif.vpp_get_memif_interface_name(
- node, sw_if_idx)
- Topology.update_interface_name(node, if_key, ifc_name)
- ifc_mac = Memif.vpp_get_memif_interface_mac(node, sw_if_idx)
- Topology.update_interface_mac_address(node, if_key, ifc_mac)
- Topology.update_interface_memif_socket(node, if_key, socket)
- Topology.update_interface_memif_id(node, if_key, mid)
- Topology.update_interface_memif_role(node, if_key, role)
- return sw_if_idx
- except KeyError:
- raise ValueError('Create Memif interface failed on node '
- '{}'.format(node['host']))
- else:
- raise ValueError('Create Memif interface failed on node '
- '{}'.format(node['host']))
+ for memif in details:
+ memif[u"hw_addr"] = str(memif[u"hw_addr"])
+ memif[u"role"] = memif[u"role"].value
+ memif[u"mode"] = memif[u"mode"].value
+ memif[u"flags"] = memif[u"flags"].value \
+ if hasattr(memif[u"flags"], u"value") else int(memif[u"flags"])