From 8542450f795a1c74a0a5868986088969a98c1834 Mon Sep 17 00:00:00 2001 From: Felipe Reyes Date: Thu, 18 Jan 2024 10:25:03 -0300 Subject: [PATCH] Sync charms.ceph The main purpose of this sync is to update the UCA_CODENAME_MAP dictionary. Also pin charm-tools<3.0.0` and jsonschema<4.18.0 to fix the build. Change-Id: I28cc1f5f7c8046dc3daed970cb183d4cde1810c8 Closes-Bug: #2049753 Related-Bug: #1951094 --- Makefile | 2 +- lib/charms_ceph/broker.py | 3 ++- lib/charms_ceph/utils.py | 22 ++++++++++++---------- test-requirements.txt | 2 ++ tox.ini | 2 +- 5 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 4e7d3f76..7af0cb14 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ ch-sync: bin/charm_helpers_sync.py $(PYTHON) bin/charm_helpers_sync.py -c charm-helpers-hooks.yaml ceph-sync: bin/git_sync.py - $(PYTHON) bin/git_sync.py -d lib -s https://github.com/openstack/charms.ceph.git + $(PYTHON) bin/git_sync.py -d lib -s https://github.com/openstack/charms.ceph.git -b stable/pacific sync: ch-sync diff --git a/lib/charms_ceph/broker.py b/lib/charms_ceph/broker.py index d00baedc..90b536fb 100644 --- a/lib/charms_ceph/broker.py +++ b/lib/charms_ceph/broker.py @@ -291,7 +291,8 @@ def pool_permission_list_for_service(service): for prefix in prefixes: permissions.append("allow {} object_prefix {}".format(permission, prefix)) - return ['mon', 'allow r, allow command "osd blacklist"', + return ['mon', ('allow r, allow command "osd blacklist"' + ', allow command "osd blocklist"'), 'osd', ', '.join(permissions)] diff --git a/lib/charms_ceph/utils.py b/lib/charms_ceph/utils.py index 9b7299dd..25566cd5 100644 --- a/lib/charms_ceph/utils.py +++ b/lib/charms_ceph/utils.py @@ -1134,7 +1134,8 @@ def get_mds_bootstrap_key(): _default_caps = collections.OrderedDict([ ('mon', ['allow r', - 'allow command "osd blacklist"']), + 'allow command "osd blacklist"', + 'allow command "osd blocklist"']), ('osd', ['allow rwx']), ]) @@ -1166,7 +1167,10 @@ osd_upgrade_caps = collections.OrderedDict([ ]) rbd_mirror_caps = collections.OrderedDict([ - ('mon', ['profile rbd; allow r']), + ('mon', ['allow profile rbd-mirror-peer', + 'allow command "service dump"', + 'allow command "service status"' + ]), ('osd', ['profile rbd']), ('mgr', ['allow r']), ]) @@ -1229,12 +1233,6 @@ def get_named_key(name, caps=None, pool_list=None): 'get', key_name, ]).decode('UTF-8')).strip() - # NOTE(jamespage); - # Apply any changes to key capabilities, dealing with - # upgrades which requires new caps for operation. - upgrade_key_caps(key_name, - caps or _default_caps, - pool_list) return parse_key(output) except subprocess.CalledProcessError: # Couldn't get the key, time to create it! @@ -2491,7 +2489,7 @@ class WatchDog(object): :type timeout: int """ start_time = time.time() - while(not wait_f()): + while not wait_f(): now = time.time() if now > start_time + timeout: raise WatchDog.WatchDogTimeoutException() @@ -3169,6 +3167,7 @@ UPGRADE_PATHS = collections.OrderedDict([ ('luminous', 'mimic'), ('mimic', 'nautilus'), ('nautilus', 'octopus'), + ('octopus', 'pacific'), ]) # Map UCA codenames to ceph codenames @@ -3186,6 +3185,9 @@ UCA_CODENAME_MAP = { 'stein': 'mimic', 'train': 'nautilus', 'ussuri': 'octopus', + 'victoria': 'octopus', + 'wallaby': 'pacific', + 'xena': 'pacific', } @@ -3375,7 +3377,7 @@ def apply_osd_settings(settings): set_cmd = base_cmd + ' set {key} {value}' def _get_cli_key(key): - return(key.replace(' ', '_')) + return key.replace(' ', '_') # Retrieve the current values to check keys are correct and to make this a # noop if setting are already applied. for osd_id in get_local_osd_ids(): diff --git a/test-requirements.txt b/test-requirements.txt index 359d4f86..c7e83561 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -46,3 +46,5 @@ git+https://opendev.org/openstack/tempest.git#egg=tempest;python_version>='3.6' tempest<24.0.0;python_version<'3.6' croniter # needed for charm-rabbitmq-server unit tests + +jsonschema<4.18.0 # depends on Rust (via rpds-py) diff --git a/tox.ini b/tox.ini index 7c434e63..b9867498 100644 --- a/tox.ini +++ b/tox.ini @@ -80,7 +80,7 @@ deps = -r{toxinidir}/requirements.txt [testenv:pep8] basepython = python3 deps = flake8==3.9.2 - charm-tools==2.8.4 + charm-tools<3.0.0 commands = flake8 {posargs} hooks unit_tests tests actions lib files charm-proof