From 4e22b80db2b29cb9b7de279e5f3ac61dd414afd3 Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 31 Oct 2017 16:56:35 +0000 Subject: [PATCH] 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 --- requires.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requires.py b/requires.py index fa9f9c7..36c52fa 100644 --- a/requires.py +++ b/requires.py @@ -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"""