fix the bug about ns_sfc 53/97453/1
authoryangyan <yangyanyj@chinamobile.com>
Wed, 23 Oct 2019 08:53:52 +0000 (16:53 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Wed, 23 Oct 2019 08:53:57 +0000 (16:53 +0800)
Change-Id: I2e48f4c0edb20cba857b85791df5b1fd60157529
Issue-ID: VFC-1561
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
lcm/ns_sfcs/views/views.py

index 68abd9d..10103fa 100644 (file)
@@ -184,7 +184,6 @@ class SfcView(APIView):
             logger.info("service_function_chain_instanceid : %s" % ignorcase_get(request.data, 'nsInstanceId'))
             logger.info("service_function_chain_sdncontrollerid : %s" % ignorcase_get(request.data, 'sdnControllerId'))
             logger.info("service_function_chain_fpindex : %s" % ignorcase_get(request.data, 'fpindex'))
-            ns_model_data = json.loads(request.data['context'])
 
             req_serializer = CreateSfcReqSerializer(data=request.data)
             if not req_serializer.is_valid():
@@ -192,6 +191,7 @@ class SfcView(APIView):
         except Exception as e:
             logger.error("Exception occurs: %s", e.args[0])
             logger.error(traceback.format_exc())
+        ns_model_data = json.loads(request.data['context'])
         data = {
             'nsinstid': ignorcase_get(request.data, 'nsInstanceId'),
             "ns_model_data": ns_model_data,