diff options
author | fujinhua <fu.jinhua@zte.com.cn> | 2019-05-08 16:29:00 +0800 |
---|---|---|
committer | fujinhua <fu.jinhua@zte.com.cn> | 2019-05-08 17:10:19 +0800 |
commit | 64556d198cf39ce45ebf6fa6ac93787b9c2e4f42 (patch) | |
tree | 2d41c6b0d56f26227c9d92f7c9a4232c650ba628 | |
parent | b3c27277e2653ec2014e111f3115a7cb39d1e5c0 (diff) |
Fix bug for ns inst
Change-Id: I5a71baa3dabf06237a1b3658634d976518c74016
Issue-ID: VFC-1306
Signed-off-by: fujinhua <fu.jinhua@zte.com.cn>
-rw-r--r-- | lcm/ns/biz/ns_instant.py | 5 | ||||
-rw-r--r-- | lcm/ns/tests/data/vnfm_in_aai.json | 2 | ||||
-rw-r--r-- | lcm/ns/tests/data/vnfm_list_in_aai.json | 2 |
3 files changed, 6 insertions, 3 deletions
diff --git a/lcm/ns/biz/ns_instant.py b/lcm/ns/biz/ns_instant.py index c16a21b1..1340790a 100644 --- a/lcm/ns/biz/ns_instant.py +++ b/lcm/ns/biz/ns_instant.py @@ -97,7 +97,10 @@ class InstantNSService(object): if isinstance(vnfm_type_temp, list): vnfm_type = vnfm_type_temp[0] vimid = self.get_vnf_vim_id(vim_id, location_constraints, vnfd_id) - vnfm_info = extsys.select_vnfm(vnfm_type=vnfm_type, vim_id=vimid) + s_vimid = vimid + if isinstance(vimid, dict): + s_vimid = "%s_%s" % (vimid["cloud_owner"], vimid["cloud_regionid"]) + vnfm_info = extsys.select_vnfm(vnfm_type=vnfm_type, vim_id=s_vimid) params_vnf.append({ "vnfProfileId": vnf["vnf_id"], diff --git a/lcm/ns/tests/data/vnfm_in_aai.json b/lcm/ns/tests/data/vnfm_in_aai.json index 6b5acc8b..3d5ff47c 100644 --- a/lcm/ns/tests/data/vnfm_in_aai.json +++ b/lcm/ns/tests/data/vnfm_in_aai.json @@ -1,6 +1,6 @@ { "type": "gvnfm", - "vim-id": {"cloud_owner": "VCPE", "cloud_regionid": "RegionOne"}, + "vim-id": "VCPE_RegionOne", "vnfm-id": "4", "certificate-url": "http://127.0.0.0/ztevnfm/v1/auth", "esr-system-info-list": { diff --git a/lcm/ns/tests/data/vnfm_list_in_aai.json b/lcm/ns/tests/data/vnfm_list_in_aai.json index a1a3678e..3db3a1a6 100644 --- a/lcm/ns/tests/data/vnfm_list_in_aai.json +++ b/lcm/ns/tests/data/vnfm_list_in_aai.json @@ -1,7 +1,7 @@ { "esr-vnfm": [{ "type": "gvnfm", - "vim-id": {"cloud_owner": "VCPE", "cloud_regionid": "RegionOne"}, + "vim-id": "VCPE_RegionOne", "vnfm-id": "4", "certificate-url": "http://127.0.0.0/ztevnfm/v1/auth", "esr-system-info-list": { |