CH Sync for rabbit relation bug fix

Charmhelper sync to pick up the fix to the AMQP context.

Change-Id: I1087bb9e49a06868368872c3c5134b6407bb1c27
Closes-Bug: #1796886
This commit is contained in:
Liam Young 2020-06-25 10:04:17 +00:00
parent 637e08105b
commit 98b194ba93
1 changed files with 19 additions and 0 deletions

View File

@ -721,6 +721,12 @@ class AMQPContext(OSContextGenerator):
rabbitmq_hosts = []
for unit in related_units(rid):
host = relation_get('private-address', rid=rid, unit=unit)
if not relation_get('password', rid=rid, unit=unit):
log(
("Skipping {} password not sent which indicates "
"unit is not ready.".format(host)),
level=DEBUG)
continue
host = format_ipv6_addr(host) or host
rabbitmq_hosts.append(host)
@ -2714,6 +2720,19 @@ class BridgePortInterfaceMap(object):
self._ifname_mac_map[ifname] = [mac]
self._mac_ifname_map[mac] = ifname
# check if interface is part of a linux bond
_bond_name = get_bond_master(ifname)
if _bond_name and _bond_name != ifname:
log('Add linux bond "{}" to map for physical interface "{}" '
'with mac "{}".'.format(_bond_name, ifname, mac),
level=DEBUG)
# for bonds we want to be able to get a list of the mac
# addresses for the physical interfaces the bond is made up of.
if self._ifname_mac_map.get(_bond_name):
self._ifname_mac_map[_bond_name].append(mac)
else:
self._ifname_mac_map[_bond_name] = [mac]
# In light of the pre-deprecation notice in the docstring of this
# class we will expose the ability to configure OVS bonds as a
# DPDK-only feature, but generally use the data structures internally.