Fix bug 733 95/7595/1
authorAdam Israel <adam.israel@canonical.com>
Mon, 3 Jun 2019 15:21:27 +0000 (11:21 -0400)
committerAdam Israel <adam.israel@canonical.com>
Mon, 3 Jun 2019 15:21:27 +0000 (11:21 -0400)
This fixes bug 733, which identified that N2VC was not properly adhering
to the Information Model regarding the vca-relationships grouping.

Change-Id: I778777446d1d4f8e8b630abfd42bd36f8479ca56
Signed-off-by: Adam Israel <adam.israel@canonical.com>
n2vc/vnf.py
tests/integration/test_charm_relate.py

index 87d5df4..1ad6d06 100644 (file)
@@ -287,9 +287,10 @@ class N2VC:
 
         vdu:
             ...
-            relation:
-            -   provides: dataVM:db
-                requires: mgmtVM:app
+            vca-relations:
+                relation:
+                -   provides: dataVM:db
+                    requires: mgmtVM:app
 
         This tells N2VC that the charm referred to by the dataVM vdu offers a relation named 'db', and the mgmtVM vdu has an 'app' endpoint that should be connected to a database.
 
@@ -341,7 +342,7 @@ class N2VC:
             if 'juju' in cfg:
                 juju = cfg['juju']
                 if 'relation' in juju:
-                    for rel in juju['relation']:
+                    for rel in juju['vca-relations']['relation']:
                         try:
 
                             # get the application name for the provides
index 7a5609e..e0f4b65 100644 (file)
@@ -110,11 +110,12 @@ class TestCharm(base.TestN2VC):
                     juju:
                         charm: proxy-ci
                         proxy: true
-                        # Relation needs to map to the vdu providing or
-                        # requiring, so that we can map to the deployed app.
-                        relation:
-                        -   provides: dataVM:db
-                            requires: mgmtVM:app
+                        vca-relations:
+                            # Relation needs to map to the vdu providing or
+                            # requiring, so that we can map to the deployed app.
+                            relation:
+                            -   provides: dataVM:db
+                                requires: mgmtVM:app
                     initial-config-primitive:
                     -   seq: '1'
                         name: test