From 3ec5687f90e0e971e584fd25cdd890aa459e00c2 Mon Sep 17 00:00:00 2001 From: Rafael Lopez Date: Tue, 21 Nov 2023 02:16:29 +0000 Subject: [PATCH] Separate relations into separate yaml document To adjust to new juju 3.2 behaviour that does not allow relations referencing overlay applications in the base bundle. Ref: https://bugs.launchpad.net/juju/+bug/2041785 Resolves: #149 Co-authored-by: Nicolas Bock --- openstack/openstack.yaml.template | 1 + tools/juju-bundle-applications.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openstack/openstack.yaml.template b/openstack/openstack.yaml.template index 8beedf0a..ebed8672 100644 --- a/openstack/openstack.yaml.template +++ b/openstack/openstack.yaml.template @@ -79,6 +79,7 @@ applications: ssl_ca: *ssl_ca ssl_cert: *ssl_cert ssl_key: *ssl_key +--- relations: - [ nova-cloud-controller:shared-db, __MYSQL_INTERFACE__ ] - [ nova-cloud-controller:amqp, rabbitmq-server ] diff --git a/tools/juju-bundle-applications.py b/tools/juju-bundle-applications.py index a721c921..2ac1600d 100755 --- a/tools/juju-bundle-applications.py +++ b/tools/juju-bundle-applications.py @@ -7,8 +7,8 @@ for filename in sys.argv[1:]: with open(filename, 'r') as f: - data = yaml.load(f, Loader=yaml.SafeLoader) - if 'applications' in data: - application_list.update(data['applications'].keys()) - + data = yaml.load_all(f, Loader=yaml.SafeLoader) + for d in data: + if 'applications' in d: + application_list.update(d['applications'].keys()) print('\n'.join(application_list))