summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-03-28 13:17:45 +0800
committerying.yunlong <ying.yunlong@zte.com.cn>2017-03-28 13:17:45 +0800
commitcae3299b6c58d67510467f7587f7315ef3f4f7d9 (patch)
tree1eaa3d1b1930b89f3d23f7c4b4b16f545474b383
parent37feb131a0d7dc25522ff52150d215ac284dd4bd (diff)
Modify adapter code to repair bugs
Change-Id: I735f62b66c34d18e207da190e184f78646360061 Issue-Id: GVNFM-44 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/lcm/nf/vnfs/const.py2
-rw-r--r--lcm/lcm/nf/vnfs/tests/test_vnf_create.py4
-rw-r--r--lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py4
-rw-r--r--lcm/lcm/pub/vimapi/adaptor.py4
4 files changed, 7 insertions, 7 deletions
diff --git a/lcm/lcm/nf/vnfs/const.py b/lcm/lcm/nf/vnfs/const.py
index 8f421ab5..122eeeb5 100644
--- a/lcm/lcm/nf/vnfs/const.py
+++ b/lcm/lcm/nf/vnfs/const.py
@@ -428,7 +428,7 @@ vnfd_model_dict = {
],
"nfv_compute": {
"num_cpus": 4,
- "mem_size": "1024MB",
+ "mem_size": "1 GB",
"cpu_frequency": "1GHz",
"flavor_extra_specs": {
"hw: cpu_policy": "shared",
diff --git a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
index 47c0372a..d7f6964f 100644
--- a/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
+++ b/lcm/lcm/nf/vnfs/tests/test_vnf_create.py
@@ -50,8 +50,8 @@ class TestNFInstantiate(TestCase):
@mock.patch.object(restcall, 'call_req')
def test_create_vnf_identifier(self, mock_call_req):
r1_get_csarid_by_vnfdid = [0, json.JSONEncoder().encode([{'package_id': '222',
- 'csar_id': '2222',
- 'vnfd_id': '111'}]), '200']
+ 'csarId': '2222',
+ 'vnfdId': '111'}]), '200']
r2_get_rawdata_from_catalog = [0, json.JSONEncoder().encode(vnfd_rawdata), '200']
mock_call_req.side_effect = [r1_get_csarid_by_vnfdid, r2_get_rawdata_from_catalog]
data = {
diff --git a/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py b/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
index 6d5fb00c..3a420639 100644
--- a/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
+++ b/lcm/lcm/nf/vnfs/vnf_create/create_vnf_identifier.py
@@ -48,8 +48,8 @@ class CreateVnf:
try:
self.package_info = get_packageinfo_by_vnfdid(self.vnfd_id)
for val in self.package_info:
- if self.vnfd_id == ignore_case_get(val, "vnfd_id"):
- self.package_id = ignore_case_get(val, "csar_id")
+ if self.vnfd_id == ignore_case_get(val, "vnfdId"):
+ self.package_id = ignore_case_get(val, "csarId")
break
raw_data = query_rawdata_from_catalog(self.package_id, self.data)
diff --git a/lcm/lcm/pub/vimapi/adaptor.py b/lcm/lcm/pub/vimapi/adaptor.py
index a09943f5..e866e692 100644
--- a/lcm/lcm/pub/vimapi/adaptor.py
+++ b/lcm/lcm/pub/vimapi/adaptor.py
@@ -194,7 +194,7 @@ def create_flavor(vim_cache, res_cache, data, flavor, do_notify, res_type):
param = {
"name": "Flavor_%s" % flavor["vdu_id"],
"vcpu": int(flavor["nfv_compute"]["num_cpus"]),
- "memory": int(flavor["nfv_compute"]["mem_size"].replace('MB', '').strip()),
+ "memory": int(flavor["nfv_compute"]["mem_size"].replace('GB', '').strip()),
"isPublic": True
}
for local_storage_id in ignore_case_get(flavor, "local_storages"):
@@ -265,7 +265,7 @@ def create_vm(vim_cache, res_cache, data, vm, do_notify, res_type):
"fileName": inject_data["file_name"],
"fileData": inject_data["file_data"]
})
- for vol_data in vm["volume_storages"]:
+ for vol_data in ignore_case_get(vm, "volume_storages"):
vol_id = vol_data["volume_storage_id"]
param["volumeArray"].append({
"volumeId": get_res_id(res_cache, RES_VOLUME, vol_id)