Sync charms.ceph helpers (pacific)

currently ceph-radosgw can't upgrade from victoria to wallaby
because UCA_CODENAME_MAP is missing wallaby.

Change-Id: I63697f594ebcdfd10e2dc1315360b2d28fc48846
This commit is contained in:
Gabriel Cocenza 2023-07-26 18:24:33 -03:00
parent a165e3a377
commit 229cf2498c
2 changed files with 14 additions and 11 deletions

View File

@ -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)]

View File

@ -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():