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 "