diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-04-11 19:27:39 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-04-11 19:27:39 +0800 |
commit | 3340d1d7039d56457cca112c93351ad326ea22cd (patch) | |
tree | 5af622a7322030ec1f1f77468d62823d258157ea /lcm/lcm/pub/vimapi/adaptor.py | |
parent | 58f68355915e553e8a7348b5f48f352eccb24f87 (diff) |
Fixed some gvnfm vnflcm adapter bugs
Change-Id: I4a306a2328a2b53927ea4dd8d9cdc3e78d14392a
Issue-Id: GVNFM-49
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'lcm/lcm/pub/vimapi/adaptor.py')
-rw-r--r-- | lcm/lcm/pub/vimapi/adaptor.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py index e866e692..9cbc7b16 100644 --- a/lcm/lcm/pub/vimapi/adaptor.py +++ b/lcm/lcm/pub/vimapi/adaptor.py @@ -183,7 +183,7 @@ def create_port(vim_cache, res_cache, data, port, do_notify, res_type): set_opt_val(param, "securityGroups", "") # TODO vim_id, tenant_name = location_info["vimid"], location_info["tenant"] tenant_id = get_tenant_id(vim_cache, vim_id, tenant_name) - ret = api.create_subnet(vim_id, tenant_id, param) + ret = api.create_port(vim_id, tenant_id, param) ret["nodeId"] = port["cp_id"] do_notify(res_type, ret) set_res_cache(res_cache, res_type, port["cp_id"], ret["id"]) @@ -202,7 +202,7 @@ def create_flavor(vim_cache, res_cache, data, flavor, do_notify, res_type): if local_storage_id != local_storage["local_storage_id"]: continue disk_type = local_storage["properties"]["disk_type"] - disk_size = int(local_storage["properties"]["size"].replace('GB', '').strip()) + disk_size = int(local_storage["properties"]["size"].replace('GB', '').strip())*1024 if disk_type == "root": param["disk"] = disk_size elif disk_type == "ephemeral": @@ -243,7 +243,7 @@ def create_vm(vim_cache, res_cache, data, vm, do_notify, res_type): if not img_name: raise VimException("Undefined image(%s)" % vm["image_file"], ERR_CODE) images = api.list_image(vim_id, tenant_id) - for image in images["imageList"]: + for image in images["images"]: if img_name == image["name"]: param["boot"]["imageId"] = image["id"] break |