diff options
-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)) |