From 1ad934bd49cd13e71bc51ddf5ef6bacd56e159cd Mon Sep 17 00:00:00 2001 From: James Page Date: Fri, 15 Nov 2024 12:09:41 +0000 Subject: [PATCH] Sync/rebuild for Dalmatian/Epoxy updates Refresh and rebuild charm for awareness of Dalmatian and Epoxy Cloud Archive releases. Change-Id: I77a2390481856ae3d78a619794bccd8378e338c1 --- charmhelpers/contrib/openstack/utils.py | 2 ++ charmhelpers/core/hookenv.py | 5 ++++- charmhelpers/core/host_factory/ubuntu.py | 2 ++ charmhelpers/fetch/ubuntu.py | 20 ++++++++++++++++++++ lib/charms_ceph/utils.py | 20 ++++++++++++++------ test-requirements.txt | 2 +- tox.ini | 5 +++++ 7 files changed, 48 insertions(+), 8 deletions(-) diff --git a/charmhelpers/contrib/openstack/utils.py b/charmhelpers/contrib/openstack/utils.py index 82c28d8..ac52d79 100644 --- a/charmhelpers/contrib/openstack/utils.py +++ b/charmhelpers/contrib/openstack/utils.py @@ -162,6 +162,8 @@ OPENSTACK_CODENAMES = OrderedDict([ ('2023.1', 'antelope'), ('2023.2', 'bobcat'), ('2024.1', 'caracal'), + ('2024.2', 'dalmatian'), + ('2025.1', 'epoxy'), ]) # The ugly duckling - must list releases oldest to newest diff --git a/charmhelpers/core/hookenv.py b/charmhelpers/core/hookenv.py index 370c3e8..1e810a2 100644 --- a/charmhelpers/core/hookenv.py +++ b/charmhelpers/core/hookenv.py @@ -18,7 +18,10 @@ # Charm Helpers Developers import copy -from distutils.version import LooseVersion +try: + from distutils.version import LooseVersion +except ImportError: + from looseversion import LooseVersion from enum import Enum from functools import wraps from collections import namedtuple, UserDict diff --git a/charmhelpers/core/host_factory/ubuntu.py b/charmhelpers/core/host_factory/ubuntu.py index 732d76c..e87595e 100644 --- a/charmhelpers/core/host_factory/ubuntu.py +++ b/charmhelpers/core/host_factory/ubuntu.py @@ -33,6 +33,8 @@ UBUNTU_RELEASES = ( 'kinetic', 'lunar', 'mantic', + 'noble', + 'oracular', ) diff --git a/charmhelpers/fetch/ubuntu.py b/charmhelpers/fetch/ubuntu.py index d0089eb..fdcad02 100644 --- a/charmhelpers/fetch/ubuntu.py +++ b/charmhelpers/fetch/ubuntu.py @@ -254,6 +254,22 @@ CLOUD_ARCHIVE_POCKETS = { 'caracal/proposed': 'jammy-proposed/caracal', 'jammy-caracal/proposed': 'jammy-proposed/caracal', 'jammy-proposed/caracal': 'jammy-proposed/caracal', + # dalmatian + 'dalmatian': 'noble-updates/dalmatian', + 'noble-dalmatian': 'noble-updates/dalmatian', + 'noble-dalmatian/updates': 'noble-updates/dalmatian', + 'noble-updates/dalmatian': 'noble-updates/dalmatian', + 'dalmatian/proposed': 'noble-proposed/dalmatian', + 'noble-dalmatian/proposed': 'noble-proposed/dalmatian', + 'noble-proposed/dalmatian': 'noble-proposed/dalmatian', + # epoxy + 'epoxy': 'noble-updates/epoxy', + 'noble-epoxy': 'noble-updates/epoxy', + 'noble-epoxy/updates': 'noble-updates/epoxy', + 'noble-updates/epoxy': 'noble-updates/epoxy', + 'epoxy/proposed': 'noble-proposed/epoxy', + 'noble-epoxy/proposed': 'noble-proposed/epoxy', + 'noble-proposed/epoxy': 'noble-proposed/epoxy', # OVN 'focal-ovn-22.03': 'focal-updates/ovn-22.03', @@ -288,6 +304,8 @@ OPENSTACK_RELEASES = ( 'antelope', 'bobcat', 'caracal', + 'dalmatian', + 'epoxy', ) @@ -318,6 +336,8 @@ UBUNTU_OPENSTACK_RELEASE = OrderedDict([ ('lunar', 'antelope'), ('mantic', 'bobcat'), ('noble', 'caracal'), + ('oracular', 'dalmatian'), + ('plucky', 'epoxy'), ]) diff --git a/lib/charms_ceph/utils.py b/lib/charms_ceph/utils.py index 63dd1fa..85e6249 100644 --- a/lib/charms_ceph/utils.py +++ b/lib/charms_ceph/utils.py @@ -1541,11 +1541,11 @@ def get_devices(name): def osdize(dev, osd_format, osd_journal, ignore_errors=False, encrypt=False, - key_manager=CEPH_KEY_MANAGER, osd_id=None): + key_manager=CEPH_KEY_MANAGER, osd_id=None, bluestore_skip=None): if dev.startswith('/dev'): osdize_dev(dev, osd_format, osd_journal, ignore_errors, encrypt, - key_manager, osd_id) + key_manager, osd_id, bluestore_skip) else: if cmp_pkgrevno('ceph', '14.0.0') >= 0: log("Directory backed OSDs can not be created on Nautilus", @@ -1556,7 +1556,7 @@ def osdize(dev, osd_format, osd_journal, ignore_errors=False, encrypt=False, def osdize_dev(dev, osd_format, osd_journal, ignore_errors=False, encrypt=False, key_manager=CEPH_KEY_MANAGER, - osd_id=None): + osd_id=None, bluestore_skip=None): """ Prepare a block device for use as a Ceph OSD @@ -1570,6 +1570,8 @@ def osdize_dev(dev, osd_format, osd_journal, ignore_errors=False, processing :param: encrypt: Encrypt block devices using 'key_manager' :param: key_manager: Key management approach for encryption keys + :param: osd_id: The ID for the newly created OSD + :param: bluestore_skip: Bluestore parameters to skip ('wal' and/or 'db') :raises subprocess.CalledProcessError: in the event that any supporting subprocess operation failed :raises ValueError: if an invalid key_manager is provided @@ -1620,7 +1622,8 @@ def osdize_dev(dev, osd_format, osd_journal, ignore_errors=False, osd_journal, encrypt, key_manager, - osd_id) + osd_id, + bluestore_skip) else: cmd = _ceph_disk(dev, osd_format, @@ -1694,7 +1697,7 @@ def _ceph_disk(dev, osd_format, osd_journal, encrypt=False): def _ceph_volume(dev, osd_journal, encrypt=False, key_manager=CEPH_KEY_MANAGER, - osd_id=None): + osd_id=None, bluestore_skip=None): """ Prepare and activate a device for usage as a Ceph OSD using ceph-volume. @@ -1706,6 +1709,7 @@ def _ceph_volume(dev, osd_journal, encrypt=False, key_manager=CEPH_KEY_MANAGER, :param: encrypt: Use block device encryption :param: key_manager: dm-crypt Key Manager to use :param: osd_id: The OSD-id to recycle, or None to create a new one + :param: bluestore_skip: Bluestore parameters to skip ('wal' and/or 'db') :raises subprocess.CalledProcessError: in the event that any supporting LVM operation failed. :returns: list. 'ceph-volume' command and required parameters for @@ -1732,7 +1736,11 @@ def _ceph_volume(dev, osd_journal, encrypt=False, key_manager=CEPH_KEY_MANAGER, encrypt=encrypt, key_manager=key_manager)) - for extra_volume in ('wal', 'db'): + extras = ('wal', 'db') + if bluestore_skip: + extras = tuple(set(extras) - set(bluestore_skip)) + + for extra_volume in extras: devices = get_devices('bluestore-{}'.format(extra_volume)) if devices: cmd.append('--block.{}'.format(extra_volume)) diff --git a/test-requirements.txt b/test-requirements.txt index 4ef87dc..e972406 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,7 +8,6 @@ # all of its own requirements and if it doesn't, fix it there. # pyparsing<3.0.0 # aodhclient is pinned in zaza and needs pyparsing < 3.0.0, but cffi also needs it, so pin here. -setuptools<50.0.0 # https://github.com/pypa/setuptools/commit/04e3df22df840c6bb244e9b27bc56750c44b7c85 requests>=2.18.4 @@ -27,3 +26,4 @@ git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.open git+https://opendev.org/openstack/tempest.git#egg=tempest croniter # needed for charm-rabbitmq-server unit tests +psutil diff --git a/tox.ini b/tox.ini index ebf2421..f4a1165 100644 --- a/tox.ini +++ b/tox.ini @@ -50,6 +50,11 @@ basepython = python3.10 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py312] +basepython = python3.12 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:py3] basepython = python3 deps = -r{toxinidir}/requirements.txt