- net_dict={'uuid': net["net_id"]}
- if net.get("type"): net_dict["type"] = net["type"]
- if net.get("name"): net_dict["name"] = net["name"]
- if net.get("vpci"): net_dict["vpci"] = net["vpci"]
- if net.get("model"): net_dict["model"] = net["model"]
- if net.get("mac_address"): net_dict["mac_address"] = net["mac_address"]
+ net_dict = {'uuid': net["net_id"]}
+ if net.get("type"):
+ if net["type"] == "SR-IOV":
+ net_dict["type"] = "VF"
+ elif net["type"] == "PCI-PASSTHROUGH":
+ net_dict["type"] = "PF"
+ else:
+ net_dict["type"] = net["type"]
+ if net.get("name"):
+ net_dict["name"] = net["name"]
+ if net.get("vpci"):
+ net_dict["vpci"] = net["vpci"]
+ if net.get("model"):
+ if net["model"] == "VIRTIO":
+ net_dict["model"] = "virtio"
+ else:
+ net_dict["model"] = net["model"]
+ if net.get("mac_address"):
+ net_dict["mac_address"] = net["mac_address"]
+ if net.get("ip_address"):
+ net_dict["ip_address"] = net["ip_address"]