summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lcm/lcm/pub/vimapi/adaptor.py8
-rw-r--r--lcm/lcm/samples/tests.py14
2 files changed, 14 insertions, 8 deletions
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py
index 4ce0e697..b7e9a34f 100644
--- a/lcm/lcm/pub/vimapi/adaptor.py
+++ b/lcm/lcm/pub/vimapi/adaptor.py
@@ -194,8 +194,12 @@ def create_port(vim_cache, res_cache, data, port, do_notify, res_type):
}
set_opt_val(param, "subnetId", subnet_id)
set_opt_val(param, "macAddress", ignore_case_get(port["properties"], "mac_address"))
- l3_address_data = port["properties"]["protocol_data"]["address_data"]["l3_address_data"]
- set_opt_val(param, "ip", ignore_case_get(l3_address_data, "fixed_ip_address"))
+ ip_address = []
+ for one_protocol_data in port["properties"]["protocol_data"]:
+ l3_address_data = one_protocol_data["address_data"]["l3_address_data"]
+ fixed_ip_address = ignore_case_get(l3_address_data, "fixed_ip_address")
+ ip_address.extend(fixed_ip_address)
+ set_opt_val(param, "ip", ip_address)
set_opt_val(param, "vnicType", ignore_case_get(port["properties"], "vnic_type"))
set_opt_val(param, "securityGroups", "") # TODO
vim_id, tenant_name = location_info["vimid"], location_info["tenant"]
diff --git a/lcm/lcm/samples/tests.py b/lcm/lcm/samples/tests.py
index c626675f..01c87deb 100644
--- a/lcm/lcm/samples/tests.py
+++ b/lcm/lcm/samples/tests.py
@@ -207,13 +207,15 @@ inst_res_data = {
"properties": {
"name": "vNat_big_subnet_port",
- "protocol_data": {
- "address_data": {
- "l3_address_data": {
- "fixed_ip_address": "10.43.38.253"
+ "protocol_data": [
+ {
+ "address_data": {
+ "l3_address_data": {
+ "fixed_ip_address": ["10.43.38.253"]
+ },
},
- },
- },
+ }
+ ],
"vnic_type": "normal",
"role": "root",
"virtual_network_interface_requirements": [