summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorKailun Qin <kailun.qin@intel.com>2018-04-16 12:14:25 +0800
committerKailun Qin <kailun.qin@intel.com>2018-04-16 12:18:57 +0800
commiteb2b62f063e14a85a66cc8dfe54cf404b9099ef8 (patch)
tree91b7bbea85df4dd5f32d82b83e88be0442a5e494 /lcm
parent11d0522e83e2d291d9513cca5f108293fe532af4 (diff)
Update ip_address in create_port following the DM
Change-Id: I9fa1d02b0c188169e83b52bfdca40c8e6eb3b990 Issue-ID: VFC-870 Signed-off-by: Kailun Qin <kailun.qin@intel.com>
Diffstat (limited to 'lcm')
-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": [