fix serializer bug 00/83300/1
authoryangyan <yangyanyj@chinamobile.com>
Tue, 26 Mar 2019 07:35:33 +0000 (15:35 +0800)
committeryangyan <yangyanyj@chinamobile.com>
Tue, 26 Mar 2019 07:35:44 +0000 (15:35 +0800)
Change-Id: I283598ef88cbf3c9ec7deeb8fd962eb46985968b
Issue-ID: VFC-1317
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
lcm/ns/serializers/sol/ext_managed_virtual_link_info.py
lcm/ns/serializers/sol/ns_instance.py

index 72a98ce..3e6bbb7 100644 (file)
@@ -29,12 +29,16 @@ class VnfLinkPortInfo(serializers.Serializer):
         allow_null=False)
     cpInstanceId = serializers.CharField(
         help_text="When the link port is used for external connectivity by the VNF, \
-        this attribute represents the identifier of the external CP of the VNF to be connected to this link port.",
+        this attribute represents the identifier of the external CP of the VNF to be connected to this \
+        link port.",
         max_length=255,
         required=False,
         allow_null=True,
         allow_blank=True)
-    cpInstanceType = serializers.ChoiceField(required=False, choices=['VNFC_CP', 'EXT_CP'], help_text="Type of the CP instance that is identified by cpInstanceId."),
+    cpInstanceType = serializers.ChoiceField(
+        required=False,
+        choices=['VNFC_CP', 'EXT_CP'],
+        help_text="Type of the CP instance that is identified by cpInstanceId.")
 
 
 class ExtManagedVirtualLinkInfo(serializers.Serializer):
index 6140654..f8e3d82 100644 (file)
@@ -19,9 +19,10 @@ from lcm.ns.serializers.sol.pub_serializers import LinkSerializer
 from lcm.ns.serializers.sol.cp_serializers import CpProtocolDataSerializer, CpProtocolInfoSerializer, VnfExtCpInfoSerializer
 from lcm.ns.serializers.sol.resource_handle import ResourceHandleSerializer
 from lcm.ns.serializers.sol.ext_virtual_link_info import ExtVirtualLinkInfoSerializer
-from lcm.ns.serializers.sol.ext_managed_virtual_link_info import ExtManagedVirtualLinkInfo
+from lcm.ns.serializers.sol.ext_managed_virtual_link_info import ExtManagedVirtualLinkInfo, VnfLinkPortInfo
 from lcm.ns.serializers.sol.pub_serializers import AffinityOrAntiAffinityRuleSerializer
 
+
 INSTANTIATION_STATE = [
     "NOT_INSTANTIATED",
     "INSTANTIATED"
@@ -110,24 +111,24 @@ class VnfcResourceInfoSerializer(serializers.Serializer):
         allow_null=True)
 
 
-class VnfLinkPortInfo(serializers.Serializer):
-    id = serializers.CharField(
-        help_text="Identifier of this link port as provided by the entity that has created the link port.",
-        max_length=255,
-        required=True,
-        allow_null=False,
-        allow_blank=False)
-    resourceHandle = ResourceHandleSerializer(
-        help_text="Reference to the virtualised network resource realizing this link port.",
-        required=True,
-        allow_null=False)
-    cpInstanceId = serializers.CharField(
-        help_text="When the link port is used for external connectivity by the VNF, \
-        this attribute represents the identifier of the external CP of the VNF to be connected to this link port.",
-        max_length=255,
-        required=False,
-        allow_null=True,
-        allow_blank=True)
+class VnfLinkPortInfo(serializers.Serializer):
+    id = serializers.CharField(
+        help_text="Identifier of this link port as provided by the entity that has created the link port.",
+        max_length=255,
+        required=True,
+        allow_null=False,
+        allow_blank=False)
+    resourceHandle = ResourceHandleSerializer(
+        help_text="Reference to the virtualised network resource realizing this link port.",
+        required=True,
+        allow_null=False)
+    cpInstanceId = serializers.CharField(
+        help_text="When the link port is used for external connectivity by the VNF, \
+        this attribute represents the identifier of the external CP of the VNF to be connected to this link port.",
+        max_length=255,
+        required=False,
+        allow_null=True,
+        allow_blank=True)
 
 
 class VnfVirtualLinkResourceInfoSerializer(serializers.Serializer):