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
This commit is contained in:
Liam Young 2021-09-30 16:39:34 +00:00
parent ae154337f7
commit c7d53bfdca
3 changed files with 10 additions and 2 deletions

View File

@ -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 "

View File

@ -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

View File

@ -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]