Further use of ordered dicts.

For consistent rendering of the haproxy template under Python 3,
ensure that ordered dictionaries are used so that dict iteration
always results in the same template output.

Change-Id: I119027810e7f7976c794ff7f34a902d256f8963d
Closes-Bug: 1737776
This commit is contained in:
James Page 2018-02-15 19:36:38 +00:00
parent 1ca4bd0ab9
commit af9a92f189
1 changed files with 2 additions and 2 deletions

View File

@ -281,7 +281,7 @@ class PeerHARelationAdapter(OpenStackRelationAdapter):
'network': 'this_unit_private_addr/private_netmask'},
'internal_addresses': ['intaddr']}
"""
relation_info = {}
relation_info = collections.OrderedDict()
try:
cluster_relid = hookenv.relation_ids('cluster')[0]
if not hookenv.related_units(relid=cluster_relid):
@ -315,7 +315,7 @@ class PeerHARelationAdapter(OpenStackRelationAdapter):
'network': 'this_unit_public_addr/public_netmask'}}
"""
config = hookenv.config()
_cluster_hosts = {}
_cluster_hosts = collections.OrderedDict()
for addr_type in ADDRESS_TYPES:
cfg_opt = os_ip.ADDRESS_MAP[addr_type]['config']
laddr = ch_ip.get_relation_ip(