From: hewei-cmss Date: Tue, 9 Jul 2019 09:05:03 +0000 (+0800) Subject: Fix ns instant X-Git-Tag: 1.3.4~40^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=8db83e4abdfd2393fd2defbdab49e64ffd5f828f;p=vfc%2Fnfvo%2Flcm.git Fix ns instant Issue-ID: VFC-1439 Signed-off-by: hewei-cmss Change-Id: Ieacdc33aaf86812cd1eb72e5eeab2bef20421209 --- 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