diff --git a/lib/charms_ceph/utils.py b/lib/charms_ceph/utils.py index a3fd276d..e9b289a4 100644 --- a/lib/charms_ceph/utils.py +++ b/lib/charms_ceph/utils.py @@ -1481,11 +1481,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 +1957,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())) diff --git a/tox.ini b/tox.ini index 20dbbfc5..b835733a 100644 --- a/tox.ini +++ b/tox.ini @@ -41,6 +41,11 @@ basepython = python3.7 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt +[testenv:py38] +basepython = python3.8 +deps = -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt + [testenv:py3] basepython = python3 deps = -r{toxinidir}/requirements.txt