From c7d53bfdca949972ee75717549ec2ed2906c63a0 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Thu, 30 Sep 2021 16:39:34 +0000 Subject: [PATCH] Support multiple gateway units Fix bug which was causing rgw not to be added to the dashboard when there were multiple units of the rgw application on Octopus. func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/646 Change-Id: I971e70afe8233982c0774b34a73fd6de70d3a0d8 --- src/charm.py | 7 +++++-- tests/tests.yaml | 1 + tox.ini | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/charm.py b/src/charm.py index 87bf3fc..8d6faee 100755 --- a/src/charm.py +++ b/src/charm.py @@ -266,13 +266,16 @@ class CephDashboardCharm(ops_openstack.core.OSBaseCharm): """Register rados gateways in dashboard db""" if self.unit.is_leader(): creds = self.radosgw_user.get_user_creds() - if len(creds) < 1: + cred_count = len(set([ + (c['access_key'], c['secret_key']) + for c in creds])) + if cred_count < 1: logging.info("No object gateway creds found") return if self._support_multiple_gateways(): self._update_multi_radosgw_creds(creds) else: - if len(creds) > 1: + if cred_count > 1: logging.error( "Cannot enable object gateway support. Ceph release " "does not support multiple object gateways in the " diff --git a/tests/tests.yaml b/tests/tests.yaml index 2e6ee87..e18b224 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -7,6 +7,7 @@ smoke_bundles: configure: - zaza.openstack.charm_tests.vault.setup.auto_initialize_no_validation - zaza.openstack.charm_tests.ceph.dashboard.setup.check_dashboard_cert + - zaza.openstack.charm_tests.ceph.dashboard.setup.set_grafana_url tests: - zaza.openstack.charm_tests.ceph.dashboard.tests.CephDashboardTest - zaza.openstack.charm_tests.ceph.tests.CephPrometheusTest diff --git a/tox.ini b/tox.ini index 31301b8..4ca4d73 100644 --- a/tox.ini +++ b/tox.ini @@ -32,6 +32,8 @@ whitelist_externals = add-to-archive.py bash charmcraft + ls + pwd passenv = HOME TERM CS_* OS_* TEST_* deps = -r{toxinidir}/test-requirements.txt @@ -127,6 +129,8 @@ commands = [testenv:func-target] basepython = python3 commands = + pwd + ls -l functest-run-suite --keep-model --bundle {posargs} [flake8]