summaryrefslogtreecommitdiffstats
path: root/lcm
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-04-11 19:27:39 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-04-11 19:27:39 +0800
commit3340d1d7039d56457cca112c93351ad326ea22cd (patch)
tree5af622a7322030ec1f1f77468d62823d258157ea /lcm
parent58f68355915e553e8a7348b5f48f352eccb24f87 (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')
-rw-r--r--lcm/lcm/nf/vnfs/const.py2
-rw-r--r--lcm/lcm/pub/vimapi/adaptor.py6
-rw-r--r--lcm/lcm/pub/vimapi/api.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/lcm/lcm/nf/vnfs/const.py b/lcm/lcm/nf/vnfs/const.py
index 122eeeb5..3967eaeb 100644
--- a/lcm/lcm/nf/vnfs/const.py
+++ b/lcm/lcm/nf/vnfs/const.py
@@ -774,7 +774,7 @@ c7_data_create_flavor ={
c8_data_list_image = {
"vimid": "",
"vimname": "",
- "imageList": [
+ "images": [
{
"status": "active",
"id": "5e2757c1-f846-4727-915c-9a872553ed75",
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
diff --git a/lcm/lcm/pub/vimapi/api.py b/lcm/lcm/pub/vimapi/api.py
index 64f40cac..0ab13354 100644
--- a/lcm/lcm/pub/vimapi/api.py
+++ b/lcm/lcm/pub/vimapi/api.py
@@ -22,7 +22,7 @@ VIM_DRIVER_BASE_URL = "openoapi/multivim/v1"
def call(vim_id, tenant_id, res, method, data=''):
if data and not isinstance(data, (str, unicode)):
data = json.JSONEncoder().encode(data)
- url = "{base_url}/{vim_id}{tenant_id}/{res}".format(
+ url = "{base_url}/{vim_id}/{tenant_id}/{res}".format(
base_url=VIM_DRIVER_BASE_URL,
vim_id=vim_id,
tenant_id="/" + tenant_id if tenant_id else "",