Add support for ceph-proxy dataset

Add parsing of munged data presented by the ceph-proxy
charm in the ceph-public-address relation key; this
includes dropping the addition of the port to the values
added to the list of monitor hosts - this is not required
and the ceph-proxy may provide that data as part of the
ceph-public-address.

This change brings this interface inline with existing
ceph context support in the openstack charm helpers.

Change-Id: Id4d7b5df711c378763d5adb54269a3ede344dd45
This commit is contained in:
James Page 2017-09-26 07:59:31 +01:00
parent 0e191799fc
commit 60d8255921
2 changed files with 11 additions and 2 deletions

4
.gitreview Normal file
View File

@ -0,0 +1,4 @@
[gerrit]
host=review.openstack.org
port=29418
project=openstack/charm-interface-ceph-client.git

View File

@ -113,7 +113,12 @@ class CephClientRequires(RelationBase):
"""List of all monitor host public addresses"""
hosts = []
addrs = self.get_remote_all('ceph-public-address')
for addr in addrs:
hosts.append('{}:6789'.format(format_ipv6_addr(addr) or addr))
for ceph_addrs in addrs:
# NOTE(jamespage): This looks odd but deals with
# use with ceph-proxy which
# presents all monitors in
# a single space delimited field.
for addr in ceph_addrs.split(' '):
hosts.append(format_ipv6_addr(addr) or addr)
hosts.sort()
return hosts