fix vnfd composer creation link between nodes
[osm/LW-UI.git] / lib / osm / osm_util.py
index 12e567b..05f73ff 100644 (file)
@@ -93,7 +93,7 @@ class OsmUtil():
             if node_type == 'cp':
                 for vld in nsd['vld']:
                     if vld['id'] == args['vld_id']:
-                        if'vnfd-connection-point-ref' not in vld:
+                        if 'vnfd-connection-point-ref' not in vld:
                             vld['vnfd-connection-point-ref'] = []
                         vld['vnfd-connection-point-ref'].append(
                             {
@@ -136,7 +136,18 @@ class OsmUtil():
                     "ip-profile-ref": "",
                     "id": element_id
                 })
-
+            if node_type == 'interface':
+                for vdu in vnfd['vdu']:
+                    if vdu['id'] == args['vdu-id']:
+                        vdu['interface'].append({
+                            "virtual-interface": {
+                                "type": "VIRTIO"
+                            },
+                            "name": element_id,
+                            "mgmt-interface": True,
+                            "type": "EXTERNAL",
+                            "external-connection-point-ref": args["external-connection-point-ref"]
+                        })
         return descriptor
 
     @staticmethod
@@ -148,4 +159,4 @@ class OsmUtil():
                 nsd = descriptor['nsd:nsd-catalog']['nsd'][0]
             nsd.update(updated)
 
-        return descriptor
\ No newline at end of file
+        return descriptor