Ensure rabbitmq host list is consistent

Sort the list of rabbitmq hosts before returning to the calling
function ensuring that the list is always presented in the same
order.  This means that its use in configuration files will be
consistent between hook invocations, avoiding service restarts
as the order won't be random.

Change-Id: I3fe80c389930569a3b4d92e44870e8f949bb62f3
Closes-Bug: 1729020
This commit is contained in:
James Page 2017-10-31 16:56:35 +00:00
parent 2e153d9b70
commit 4e22b80db2
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ class RabbitMQRequires(RelationBase):
return list(set(values))
def rabbitmq_hosts(self):
return self.get_remote_all('private-address')
return sorted(self.get_remote_all('private-address'))
def get_ssl_cert(self):
"""Return decoded CA cert from rabbit or None if no CA present"""