diff --git a/hooks/ceph.py b/hooks/ceph.py index 8ce22a8..d6213a7 100644 --- a/hooks/ceph.py +++ b/hooks/ceph.py @@ -347,8 +347,8 @@ _upgrade_caps = { } -def get_radosgw_key(): - return get_named_key('radosgw.gateway', _radosgw_caps) +def get_radosgw_key(name='radosgw.gateway'): + return get_named_key(name, _radosgw_caps) _default_caps = collections.OrderedDict([ diff --git a/hooks/ceph_hooks.py b/hooks/ceph_hooks.py index 0c16d39..0c72f29 100755 --- a/hooks/ceph_hooks.py +++ b/hooks/ceph_hooks.py @@ -176,10 +176,18 @@ def radosgw_relation(relid=None, unit=None): ceph_addrs = config('monitor-hosts') data = { 'fsid': config('fsid'), - 'radosgw_key': ceph.get_radosgw_key(), 'auth': config('auth-supported'), 'ceph-public-address': ceph_addrs, } + key_name = relation_get('key_name', unit=unit, rid=relid) + if key_name: + # New style, per unit keys + data['{}_key'.format(key_name)] = ( + ceph.get_radosgw_key(name=key_name) + ) + else: + # Old style global radosgw key + data['radosgw_key'] = ceph.get_radosgw_key() settings = relation_get(rid=relid, unit=unit) or {} """Process broker request(s).""" diff --git a/tests/tests.yaml b/tests/tests.yaml index 97ff13d..0c7eb8a 100644 --- a/tests/tests.yaml +++ b/tests/tests.yaml @@ -54,6 +54,12 @@ target_deploy_status: nova-compute: workload-status: waiting workload-status-message: "Incomplete relations: storage-backend" + cinder-ceph: + workload-status: waiting + workload-status-message: "Ceph broker request incomplete" + glance: + workload-status: waiting + workload-status-message: "Incomplete relations: storage-backend" tests_options: force_deploy: