def get_osm_params(db_vnfr, vdu_id=None, vdu_count_index=0):
osm_params = {
- x.replace("-", "_"): db_vnfr[x] for x in ("ip-address", "vim-account-id", "vnfd-id", "vnfd-ref")
+ x.replace("-", "_"): db_vnfr[x]
+ for x in ("ip-address", "vim-account-id", "vnfd-id", "vnfd-ref")
if db_vnfr.get(x) is not None
}
osm_params["ns_id"] = db_vnfr["nsr-id-ref"]
vdu = {
"count_index": vdur["count-index"],
"vdu_id": vdur["vdu-id-ref"],
- "interfaces": {}
+ "interfaces": {},
}
if vdur.get("ip-address"):
vdu["ip_address"] = vdur["ip-address"]
for iface in vdur["interfaces"]:
- vdu["interfaces"][iface["name"]] = \
- {x.replace("-", "_"): iface[x] for x in ("mac-address", "ip-address", "name")
- if iface.get(x) is not None}
+ vdu["interfaces"][iface["name"]] = {
+ x.replace("-", "_"): iface[x]
+ for x in ("mac-address", "ip-address", "name")
+ if iface.get(x) is not None
+ }
vdu_id_index = "{}-{}".format(vdur["vdu-id-ref"], vdur["count-index"])
osm_params["vdu"][vdu_id_index] = vdu
if vdu_id: