summaryrefslogtreecommitdiffstats
path: root/lcm/lcm/nf/biz/instantiate_vnf.py
diff options
context:
space:
mode:
authorhongyuzhao <zhao.hongyu@zte.com.cn>2019-06-28 09:51:33 +0800
committerhongyuzhao <zhao.hongyu@zte.com.cn>2019-07-03 11:19:09 +0800
commit46ad7c172411214c5432ed93fda4271288077447 (patch)
tree74adb32f9cdfe575184e67068faac9bc6c2117b7 /lcm/lcm/nf/biz/instantiate_vnf.py
parent37b1ae2386c365293249421595f0722c25bc8e8d (diff)
vfclcm upgrade from python2 to python3
Change-Id: Ia55ae38ec64fc3d821d1e7e1c0cbe48b572a0dd4 Issue-ID: VFC-1429 Signed-off-by: hongyuzhao <zhao.hongyu@zte.com.cn>
Diffstat (limited to 'lcm/lcm/nf/biz/instantiate_vnf.py')
-rw-r--r--lcm/lcm/nf/biz/instantiate_vnf.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/lcm/lcm/nf/biz/instantiate_vnf.py b/lcm/lcm/nf/biz/instantiate_vnf.py
index 0ecd95e1..57711f75 100644
--- a/lcm/lcm/nf/biz/instantiate_vnf.py
+++ b/lcm/lcm/nf/biz/instantiate_vnf.py
@@ -83,9 +83,9 @@ class InstantiateVnf(Thread):
operation_state=OPERATION_STATE_TYPE.COMPLETED
)
except NFLCMException as e:
- self.vnf_inst_failed_handle(e.message)
+ self.vnf_inst_failed_handle(e.args[0])
except Exception as e:
- logger.error(e.message)
+ logger.error(str(e))
logger.error(traceback.format_exc())
self.vnf_inst_failed_handle('unexpected exception')
@@ -113,9 +113,9 @@ class InstantiateVnf(Thread):
input_parameters = []
inputs = ignore_case_get(self.data, "additionalParams")
if inputs:
- if isinstance(inputs, (str, unicode)):
+ if isinstance(inputs, str):
inputs = json.loads(inputs)
- for key, val in inputs.items():
+ for key, val in list(inputs.items()):
input_parameters.append({"key": key, "value": val})
vnf_package = query_vnfpackage_by_id(self.vnfd_id)
pkg_info = ignore_case_get(vnf_package, "packageInfo")
@@ -198,7 +198,7 @@ class InstantiateVnf(Thread):
resp = notify_lcm_to_nfvo(json.dumps(notification_content))
logger.info('Lcm notify end, response %s' % resp)
except Exception as e:
- logger.error("Lcm instantiate notify failed: %s", e.message)
+ logger.error("Lcm instantiate notify failed: %s", e.args[0])
NotificationsUtil().send_notification(notification_content)
def vnf_inst_failed_handle(self, error_msg):