Change-Id: I5afdfd737506882687ed938fc790e33433c0f396
Signed-off-by: 36970 <jegan.s@tataelxsi.co.in>
"vnf member index",
"vnfd name",
"vim account id",
- "ip address",
+ "mgmt ip address",
]
if long:
field_names = [
"vnf member index",
"vnfd name",
"vim account id",
- "ip address",
+ "mgmt ip address",
"date",
"last update",
+ "vdu ip addresses",
]
table = PrettyTable(field_names)
for vnfr in resp:
last_update = datetime.fromtimestamp(vnfr["_admin"]["modified"]).strftime(
"%Y-%m-%dT%H:%M:%S"
)
- new_row.extend([date, last_update])
+ vdu_ip_addresses = (
+ [
+ vnfr["vdur"][vdur]["interfaces"][interface].get("ip-address")
+ for vdur in range(len(vnfr["vdur"]))
+ for interface in range(len(vnfr["vdur"][vdur]["interfaces"]))
+ ],
+ )
+ new_row.extend([date, last_update, vdu_ip_addresses])
table.add_row(new_row)
print_output.print_output(output, table.field_names, table._rows)