Sync charm-helpers for Victoria/Groovy updates

This sync picks up the release and version details for Victoria/Groovy.

Change-Id: I459b37cb22ac00d8d4fd9983d9a995b475a0207d
This commit is contained in:
Corey Bryant 2020-07-13 18:59:12 +00:00
parent ad656e515d
commit 189e0c2b98
8 changed files with 87 additions and 4 deletions

View File

@ -300,6 +300,8 @@ class OpenStackAmuletDeployment(AmuletDeployment):
('disco', None): self.disco_stein, ('disco', None): self.disco_stein,
('eoan', None): self.eoan_train, ('eoan', None): self.eoan_train,
('focal', None): self.focal_ussuri, ('focal', None): self.focal_ussuri,
('focal', 'cloud:focal-victoria'): self.focal_victoria,
('groovy', None): self.groovy_victoria,
} }
return releases[(self.series, self.openstack)] return releases[(self.series, self.openstack)]
@ -319,6 +321,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
('disco', 'stein'), ('disco', 'stein'),
('eoan', 'train'), ('eoan', 'train'),
('focal', 'ussuri'), ('focal', 'ussuri'),
('groovy', 'victoria'),
]) ])
if self.openstack: if self.openstack:
os_origin = self.openstack.split(':')[1] os_origin = self.openstack.split(':')[1]

View File

@ -63,6 +63,7 @@ OPENSTACK_RELEASES_PAIRS = [
'bionic_stein', 'disco_stein', 'bionic_stein', 'disco_stein',
'bionic_train', 'eoan_train', 'bionic_train', 'eoan_train',
'bionic_ussuri', 'focal_ussuri', 'bionic_ussuri', 'focal_ussuri',
'focal_victoria', 'groovy_victoria',
] ]

View File

@ -721,6 +721,12 @@ class AMQPContext(OSContextGenerator):
rabbitmq_hosts = [] rabbitmq_hosts = []
for unit in related_units(rid): for unit in related_units(rid):
host = relation_get('private-address', rid=rid, unit=unit) 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 host = format_ipv6_addr(host) or host
rabbitmq_hosts.append(host) rabbitmq_hosts.append(host)
@ -2714,6 +2720,19 @@ class BridgePortInterfaceMap(object):
self._ifname_mac_map[ifname] = [mac] self._ifname_mac_map[ifname] = [mac]
self._mac_ifname_map[mac] = ifname 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 # In light of the pre-deprecation notice in the docstring of this
# class we will expose the ability to configure OVS bonds as a # class we will expose the ability to configure OVS bonds as a
# DPDK-only feature, but generally use the data structures internally. # DPDK-only feature, but generally use the data structures internally.
@ -2779,6 +2798,17 @@ class BridgePortInterfaceMap(object):
self.add_interface( self.add_interface(
bridge, portname, ifname, iftype, pci_address, global_mtu) bridge, portname, ifname, iftype, pci_address, global_mtu)
if not macs:
# We have not mapped the interface and it is probably some sort
# of virtual interface. Our user have put it in the config with
# a purpose so let's carry out their wish. LP: #1884743
log('Add unmapped interface from config: name "{}" bridge "{}"'
.format(ifname, bridge),
level=DEBUG)
self.add_interface(
bridge, ifname, ifname, self.interface_type.system, None,
global_mtu)
def __getitem__(self, key): def __getitem__(self, key):
"""Provide a Dict-like interface, get value of item. """Provide a Dict-like interface, get value of item.

View File

@ -143,6 +143,7 @@ OPENSTACK_RELEASES = (
'stein', 'stein',
'train', 'train',
'ussuri', 'ussuri',
'victoria',
) )
UBUNTU_OPENSTACK_RELEASE = OrderedDict([ UBUNTU_OPENSTACK_RELEASE = OrderedDict([
@ -164,6 +165,7 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([
('disco', 'stein'), ('disco', 'stein'),
('eoan', 'train'), ('eoan', 'train'),
('focal', 'ussuri'), ('focal', 'ussuri'),
('groovy', 'victoria'),
]) ])
@ -186,6 +188,7 @@ OPENSTACK_CODENAMES = OrderedDict([
('2019.1', 'stein'), ('2019.1', 'stein'),
('2019.2', 'train'), ('2019.2', 'train'),
('2020.1', 'ussuri'), ('2020.1', 'ussuri'),
('2020.2', 'victoria'),
]) ])
# The ugly duckling - must list releases oldest to newest # The ugly duckling - must list releases oldest to newest
@ -226,6 +229,8 @@ SWIFT_CODENAMES = OrderedDict([
['2.22.0', '2.23.0']), ['2.22.0', '2.23.0']),
('ussuri', ('ussuri',
['2.24.0', '2.25.0']), ['2.24.0', '2.25.0']),
('victoria',
['2.25.0']),
]) ])
# >= Liberty version->codename mapping # >= Liberty version->codename mapping
@ -241,6 +246,7 @@ PACKAGE_CODENAMES = {
('19', 'stein'), ('19', 'stein'),
('20', 'train'), ('20', 'train'),
('21', 'ussuri'), ('21', 'ussuri'),
('22', 'victoria'),
]), ]),
'neutron-common': OrderedDict([ 'neutron-common': OrderedDict([
('7', 'liberty'), ('7', 'liberty'),
@ -253,6 +259,7 @@ PACKAGE_CODENAMES = {
('14', 'stein'), ('14', 'stein'),
('15', 'train'), ('15', 'train'),
('16', 'ussuri'), ('16', 'ussuri'),
('17', 'victoria'),
]), ]),
'cinder-common': OrderedDict([ 'cinder-common': OrderedDict([
('7', 'liberty'), ('7', 'liberty'),
@ -265,6 +272,7 @@ PACKAGE_CODENAMES = {
('14', 'stein'), ('14', 'stein'),
('15', 'train'), ('15', 'train'),
('16', 'ussuri'), ('16', 'ussuri'),
('17', 'victoria'),
]), ]),
'keystone': OrderedDict([ 'keystone': OrderedDict([
('8', 'liberty'), ('8', 'liberty'),
@ -277,6 +285,7 @@ PACKAGE_CODENAMES = {
('15', 'stein'), ('15', 'stein'),
('16', 'train'), ('16', 'train'),
('17', 'ussuri'), ('17', 'ussuri'),
('18', 'victoria'),
]), ]),
'horizon-common': OrderedDict([ 'horizon-common': OrderedDict([
('8', 'liberty'), ('8', 'liberty'),
@ -289,6 +298,7 @@ PACKAGE_CODENAMES = {
('15', 'stein'), ('15', 'stein'),
('16', 'train'), ('16', 'train'),
('18', 'ussuri'), ('18', 'ussuri'),
('19', 'victoria'),
]), ]),
'ceilometer-common': OrderedDict([ 'ceilometer-common': OrderedDict([
('5', 'liberty'), ('5', 'liberty'),
@ -301,6 +311,7 @@ PACKAGE_CODENAMES = {
('12', 'stein'), ('12', 'stein'),
('13', 'train'), ('13', 'train'),
('14', 'ussuri'), ('14', 'ussuri'),
('15', 'victoria'),
]), ]),
'heat-common': OrderedDict([ 'heat-common': OrderedDict([
('5', 'liberty'), ('5', 'liberty'),
@ -313,6 +324,7 @@ PACKAGE_CODENAMES = {
('12', 'stein'), ('12', 'stein'),
('13', 'train'), ('13', 'train'),
('14', 'ussuri'), ('14', 'ussuri'),
('15', 'victoria'),
]), ]),
'glance-common': OrderedDict([ 'glance-common': OrderedDict([
('11', 'liberty'), ('11', 'liberty'),
@ -325,6 +337,7 @@ PACKAGE_CODENAMES = {
('18', 'stein'), ('18', 'stein'),
('19', 'train'), ('19', 'train'),
('20', 'ussuri'), ('20', 'ussuri'),
('21', 'victoria'),
]), ]),
'openstack-dashboard': OrderedDict([ 'openstack-dashboard': OrderedDict([
('8', 'liberty'), ('8', 'liberty'),
@ -337,6 +350,7 @@ PACKAGE_CODENAMES = {
('15', 'stein'), ('15', 'stein'),
('16', 'train'), ('16', 'train'),
('18', 'ussuri'), ('18', 'ussuri'),
('19', 'victoria'),
]), ]),
} }

View File

@ -372,8 +372,10 @@ class Config(dict):
try: try:
self._prev_dict = json.load(f) self._prev_dict = json.load(f)
except ValueError as e: except ValueError as e:
log('Unable to parse previous config data - {}'.format(str(e)), log('Found but was unable to parse previous config data, '
level=ERROR) 'ignoring which will report all values as changed - {}'
.format(str(e)), level=ERROR)
return
for k, v in copy.deepcopy(self._prev_dict).items(): for k, v in copy.deepcopy(self._prev_dict).items():
if k not in self: if k not in self:
self[k] = v self[k] = v

View File

@ -190,6 +190,14 @@ CLOUD_ARCHIVE_POCKETS = {
'ussuri/proposed': 'bionic-proposed/ussuri', 'ussuri/proposed': 'bionic-proposed/ussuri',
'bionic-ussuri/proposed': 'bionic-proposed/ussuri', 'bionic-ussuri/proposed': 'bionic-proposed/ussuri',
'bionic-proposed/ussuri': 'bionic-proposed/ussuri', 'bionic-proposed/ussuri': 'bionic-proposed/ussuri',
# Victoria
'victoria': 'focal-updates/victoria',
'focal-victoria': 'focal-updates/victoria',
'focal-victoria/updates': 'focal-updates/victoria',
'focal-updates/victoria': 'focal-updates/victoria',
'victoria/proposed': 'focal-proposed/victoria',
'focal-victoria/proposed': 'focal-proposed/victoria',
'focal-proposed/victoria': 'focal-proposed/victoria',
} }

View File

@ -540,11 +540,13 @@ def handle_remove_cache_tier(request, service):
pool.remove_cache_tier(cache_pool=cache_pool) pool.remove_cache_tier(cache_pool=cache_pool)
def handle_set_pool_value(request, service): def handle_set_pool_value(request, service, coerce=False):
"""Sets an arbitrary pool value. """Sets an arbitrary pool value.
:param request: dict of request operations and params :param request: dict of request operations and params
:param service: The ceph client to run the command under. :param service: The ceph client to run the command under.
:param coerce: Try to parse/coerce the value into the correct type.
Used by the action code that only gets Str from Juju
:returns: dict. exit-code and reason if not 0 :returns: dict. exit-code and reason if not 0
""" """
# Set arbitrary pool values # Set arbitrary pool values
@ -558,6 +560,16 @@ def handle_set_pool_value(request, service):
# Get the validation method # Get the validation method
validator_params = POOL_KEYS[params['key']] validator_params = POOL_KEYS[params['key']]
# BUG: #1838650 - the function needs to try to coerce the value param to
# the type required for the validator to pass. Note, if this blows, then
# the param isn't parsable to the correct type.
if coerce:
try:
params['value'] = validator_params[0](params['value'])
except ValueError:
raise RuntimeError("Value {} isn't of type {}"
.format(params['value'], validator_params[0]))
# end of BUG: #1838650
if len(validator_params) == 1: if len(validator_params) == 1:
# Validate that what the user passed is actually legal per Ceph's rules # Validate that what the user passed is actually legal per Ceph's rules
validator(params['value'], validator_params[0]) validator(params['value'], validator_params[0])

View File

@ -2183,6 +2183,9 @@ def upgrade_monitor(new_version):
log("Current ceph version is {}".format(current_version)) log("Current ceph version is {}".format(current_version))
log("Upgrading to: {}".format(new_version)) log("Upgrading to: {}".format(new_version))
# Needed to determine if whether to stop/start ceph-mgr
luminous_or_later = cmp_pkgrevno('ceph-common', '12.2.0') >= 0
try: try:
add_source(config('source'), config('key')) add_source(config('source'), config('key'))
apt_update(fatal=True) apt_update(fatal=True)
@ -2194,6 +2197,10 @@ def upgrade_monitor(new_version):
try: try:
if systemd(): if systemd():
service_stop('ceph-mon') service_stop('ceph-mon')
log("restarting ceph-mgr.target maybe: {}"
.format(luminous_or_later))
if luminous_or_later:
service_stop('ceph-mgr.target')
else: else:
service_stop('ceph-mon-all') service_stop('ceph-mon-all')
apt_install(packages=determine_packages(), fatal=True) apt_install(packages=determine_packages(), fatal=True)
@ -2217,7 +2224,13 @@ def upgrade_monitor(new_version):
perms=0o755) perms=0o755)
if systemd(): if systemd():
service_start('ceph-mon') service_restart('ceph-mon')
log("starting ceph-mgr.target maybe: {}".format(luminous_or_later))
if luminous_or_later:
# due to BUG: #1849874 we have to force a restart to get it to
# drop the previous version of ceph-manager and start the new
# one.
service_restart('ceph-mgr.target')
else: else:
service_start('ceph-mon-all') service_start('ceph-mon-all')
except subprocess.CalledProcessError as err: except subprocess.CalledProcessError as err: