From 47998e0a2e15749f7da945a97cef1dc792c86353 Mon Sep 17 00:00:00 2001 From: Adam Israel Date: Mon, 3 Jun 2019 11:21:27 -0400 Subject: [PATCH] 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 --- n2vc/vnf.py | 9 +++++---- tests/integration/test_charm_relate.py | 11 ++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) 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 -- 2.17.1