fix bug for vnfm grant request in terminate opratio 42/92242/2
authorhongyuzhao <zhao.hongyu@zte.com.cn>
Tue, 30 Jul 2019 06:17:41 +0000 (14:17 +0800)
committerhongyuzhao <zhao.hongyu@zte.com.cn>
Tue, 30 Jul 2019 06:29:13 +0000 (14:29 +0800)
Change-Id: Iecf572519efdf355dcd84e60eb339aaa9909f812
Issue-ID: VFC-1462
Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
lcm/lcm/nf/biz/grant_vnf.py

index 80ff035..f7cdeaa 100644 (file)
@@ -62,7 +62,12 @@ def grant_resource(data, nf_inst_id, job_id, grant_type, vdus):
             content_args['removeResources'].append(res_def)
             res_index += 1
         if vdus and vdus[0].vimid:
-            content_args['additionalParams']['vimid'] = vdus[0].vimid
+            split_vim = vdus[0].vimid.split('_')
+            cloud_owner = split_vim[0]
+            cloud_region = "".join(split_vim[1:])
+            content_args['additionalParams']['vimid'] = json.dumps({
+                "cloud_owner": cloud_owner,
+                'cloud_regionid': cloud_region})
     elif grant_type == GRANT_TYPE.INSTANTIATE:
         vim_id = ignore_case_get(ignore_case_get(data, "additionalParams"), "vimId")
         res_index = 1