From: Adam Israel Date: Mon, 3 Jun 2019 15:21:27 +0000 (-0400) Subject: Fix bug 733 X-Git-Tag: v6.0.0~4 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=commitdiff_plain;h=47998e0a2e15749f7da945a97cef1dc792c86353 Fix bug 733 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 --- diff --git a/n2vc/vnf.py b/n2vc/vnf.py index 87d5df4..1ad6d06 100644 --- a/n2vc/vnf.py +++ b/n2vc/vnf.py @@ -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 diff --git a/tests/integration/test_charm_relate.py b/tests/integration/test_charm_relate.py index 7a5609e..e0f4b65 100644 --- a/tests/integration/test_charm_relate.py +++ b/tests/integration/test_charm_relate.py @@ -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