summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhewei-cmss <hewei@cmss.chinamobile.com>2019-07-09 17:05:03 +0800
committerhewei-cmss <hewei@cmss.chinamobile.com>2019-07-09 17:44:16 +0800
commit8db83e4abdfd2393fd2defbdab49e64ffd5f828f (patch)
tree58aac5db9131cf2c44753db1adb22635f71934ed
parenteb6f5bef87dbb375f81095c9620976de0904631d (diff)
Fix ns instant
Issue-ID: VFC-1439 Signed-off-by: hewei-cmss <hewei@cmss.chinamobile.com> Change-Id: Ieacdc33aaf86812cd1eb72e5eeab2bef20421209
-rw-r--r--lcm/ns/biz/ns_instant.py2
-rw-r--r--lcm/ns/views/sol/instantiate_ns_views.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/lcm/ns/biz/ns_instant.py b/lcm/ns/biz/ns_instant.py
index 39ddecf5..ada85e82 100644
--- a/lcm/ns/biz/ns_instant.py
+++ b/lcm/ns/biz/ns_instant.py
@@ -191,7 +191,7 @@ class InstantNSService(object):
JobUtil.add_job_status(job_id, 10, 'NS inst(%s) wso2 workflow started: %s' % (
self.ns_inst_id, ret.get('status')))
if ret.get('status') == 1:
- return dict(data={'jobId': job_id}, status=status.HTTP_200_OK)
+ return dict(data={'jobId': job_id}, status=status.HTTP_200_OK, occ_id=occ_id)
return dict(data={'error': ret['message']}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
def start_activiti_workflow(self, job_id, plan_input, occ_id):
diff --git a/lcm/ns/views/sol/instantiate_ns_views.py b/lcm/ns/views/sol/instantiate_ns_views.py
index 615f43c2..ae8c51d4 100644
--- a/lcm/ns/views/sol/instantiate_ns_views.py
+++ b/lcm/ns/views/sol/instantiate_ns_views.py
@@ -57,7 +57,9 @@ class InstantiateNsView(APIView):
InstantNsReq['locationConstraints'].append(vnf)
ack = InstantNSService(ns_instance_id, request.data).do_biz()
- nsLcmOpOccId = ack['occ_id']
+ nsLcmOpOccId = ack.get('occ_id')
+ if not nsLcmOpOccId:
+ return Response(data=ack['data'], status=ack['status'])
response = Response(data={}, status=status.HTTP_202_ACCEPTED)
logger.debug("Location: %s" % ack['occ_id'])
response["Location"] = NS_OCC_BASE_URI % nsLcmOpOccId