diff options
author | hewei-cmss <hewei@cmss.chinamobile.com> | 2019-07-01 21:02:21 +0800 |
---|---|---|
committer | hewei-cmss <hewei@cmss.chinamobile.com> | 2019-07-01 21:02:21 +0800 |
commit | f2a5c03d4d695a5f10c1275aa1aa12c9279b5950 (patch) | |
tree | cd1dd2711347a0f68bc604b5d1c69ad472415eb5 | |
parent | 19ed1a22bfecf7e6c4f714d5ca5be422dd52c6f7 (diff) |
Optimize ns instant.
Issue-ID: VFC-1435
Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com>
Change-Id: Ic74c73980fdbdcd583da4e0e18ecb17ee8cf3b2f
-rw-r--r-- | lcm/ns/biz/ns_instant.py | 4 | ||||
-rw-r--r-- | lcm/pub/utils/jobutil.py | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/lcm/ns/biz/ns_instant.py b/lcm/ns/biz/ns_instant.py index 1340790a..c2653aa7 100644 --- a/lcm/ns/biz/ns_instant.py +++ b/lcm/ns/biz/ns_instant.py @@ -97,9 +97,7 @@ 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) - s_vimid = vimid - if isinstance(vimid, dict): - s_vimid = "%s_%s" % (vimid["cloud_owner"], vimid["cloud_regionid"]) + 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({ diff --git a/lcm/pub/utils/jobutil.py b/lcm/pub/utils/jobutil.py index 8a68fcbb..414e6ba5 100644 --- a/lcm/pub/utils/jobutil.py +++ b/lcm/pub/utils/jobutil.py @@ -18,6 +18,7 @@ import traceback import uuid from lcm.pub.database.models import JobStatusModel, JobModel +from lcm.pub.enum import JOB_PROGRESS from lcm.pub.enum import JOB_STATUS from lcm.pub.utils import idutil @@ -65,7 +66,7 @@ class JobUtil(object): job.status = JOB_STATUS.PROCESSING job.user = user job.starttime = datetime.datetime.now().strftime('%Y-%m-%d %X') - job.progress = 0 + job.progress = JOB_PROGRESS.STARTED job.resname = res_name logger.debug("create a new job, jobid=%s, jobtype=%s, jobaction=%s, resid=%s, status=%d" % (job.jobid, job.jobtype, job.jobaction, job.resid, job.status)) |