From 59160b08151a4a8e5a743c141f45c529547254af Mon Sep 17 00:00:00 2001 From: Liam Young Date: Tue, 19 May 2020 08:18:36 +0000 Subject: [PATCH] Sync charms.ceph Sync charms.ceph to pick up fix for LP #1851869 Change-Id: Ie3027d030c71faec0108fcde7fdd624b29623d49 Closes-Bug: #1851869 Partial-Bug: #1879464 --- lib/charms_ceph/utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/charms_ceph/utils.py b/lib/charms_ceph/utils.py index a3fd276d..7a0cb7d4 100644 --- a/lib/charms_ceph/utils.py +++ b/lib/charms_ceph/utils.py @@ -1139,8 +1139,9 @@ osd_upgrade_caps = collections.OrderedDict([ ]) rbd_mirror_caps = collections.OrderedDict([ - ('mon', ['profile rbd']), + ('mon', ['profile rbd; allow r']), ('osd', ['profile rbd']), + ('mgr', ['allow r']), ]) @@ -1481,11 +1482,11 @@ def get_devices(name): :returns: Set(device names), which are strings """ if config(name): - devices = [l.strip() for l in config(name).split(' ')] + devices = [dev.strip() for dev in config(name).split(' ')] else: devices = [] storage_ids = storage_list(name) - devices.extend((storage_get('location', s) for s in storage_ids)) + devices.extend((storage_get('location', sid) for sid in storage_ids)) devices = filter(os.path.exists, devices) return set(devices) @@ -1957,6 +1958,9 @@ def _allocate_logical_volume(dev, lv_type, osd_fsid, vg_name = None if not lvm.is_lvm_physical_volume(pv_dev): lvm.create_lvm_physical_volume(pv_dev) + if not os.path.exists(pv_dev): + # NOTE: trigger rescan to work around bug 1878752 + rescan_osd_devices() if shared: vg_name = 'ceph-{}-{}'.format(lv_type, str(uuid.uuid4()))