Create port refer to the new DM datamodel 51/42251/2
authorKailun Qin <kailun.qin@intel.com>
Wed, 11 Apr 2018 11:54:23 +0000 (19:54 +0800)
committerKailun Qin <kailun.qin@intel.com>
Wed, 11 Apr 2018 12:17:55 +0000 (20:17 +0800)
Change-Id: Ie3c2e43cce6ca9cc195447c11f2a170519e0bd1d
Issue-ID: VFC-870
Signed-off-by: Kailun Qin <kailun.qin@intel.com>
lcm/lcm/pub/vimapi/adaptor.py
lcm/lcm/samples/tests.py

index 3264f94..4ce0e69 100644 (file)
@@ -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"]
index 9c57d84..c626675 100644 (file)
@@ -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": [