summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorKailun Qin <kailun.qin@intel.com>2018-04-11 19:54:23 +0800
committerKailun Qin <kailun.qin@intel.com>2018-04-11 20:17:55 +0800
commit5bbae495d57db892fe0f43e8841c412f6f6a095e (patch)
treeabbf9ef9be71c25ae1810d0917db545ce575ee50 /lcm
parentbb05def6ff9bf6f2df33641a3ce91c4494100dc8 (diff)
Create port refer to the new DM datamodel
Change-Id: Ie3c2e43cce6ca9cc195447c11f2a170519e0bd1d 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.py3
-rw-r--r--lcm/lcm/samples/tests.py9
2 files changed, 10 insertions, 2 deletions
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py
index 3264f94f..4ce0e697 100644
--- a/lcm/lcm/pub/vimapi/adaptor.py
+++ b/lcm/lcm/pub/vimapi/adaptor.py
@@ -194,7 +194,8 @@ 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"))
- set_opt_val(param, "ip", ignore_case_get(port["properties"], "ip_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"))
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 9c57d84e..c626675f 100644
--- a/lcm/lcm/samples/tests.py
+++ b/lcm/lcm/samples/tests.py
@@ -204,9 +204,16 @@ inst_res_data = {
],
"cps": [
{
+
"properties": {
"name": "vNat_big_subnet_port",
- "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": [