From 3ad589141974fcc5c3ae731b29c7a44d90c4afe4 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Thu, 25 Jun 2020 10:04:17 +0000 Subject: [PATCH] CH Sync for rabbit relation bug fix Charmhelper sync to pick up the fix to the AMQP context. Change-Id: I663dca207a42707859396d97edc5bbe3f24b29ba Closes-Bug: #1796886 --- charmhelpers/contrib/openstack/context.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/charmhelpers/contrib/openstack/context.py b/charmhelpers/contrib/openstack/context.py index 335e2d5c..540677c9 100644 --- a/charmhelpers/contrib/openstack/context.py +++ b/charmhelpers/contrib/openstack/context.py @@ -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.