Fix pristine status

Only check configured devices instead of all system devices and don't check already processed devices when computing pristine status

Closes-Bug: #1988088
Change-Id: Ia6bf7a5b7abddb72c3ec61fd9e02daf42e94c2da
func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/1025
This commit is contained in:
Peter Sabaini 2023-03-14 10:55:08 +01:00 committed by Peter Sabaini
parent 8c7ae6889a
commit 22dfd2cc8f
1 changed files with 6 additions and 2 deletions

View File

@ -849,8 +849,12 @@ def assess_status():
'Unit is ready ({} OSD)'.format(len(running_osds)))
else:
pristine = True
osd_journals = get_journal_devices()
for dev in list(set(ceph.unmounted_disks()) - set(osd_journals)):
# Check unmounted disks that should be configured but don't check
# journals or already processed devices
config_devices = (set(get_devices()) & set(ceph.unmounted_disks()))
osd_journals = set(get_journal_devices())
touched_devices = set(kv().get('osd-devices', []))
for dev in config_devices - osd_journals - touched_devices:
if (not ceph.is_active_bluestore_device(dev) and
not ceph.is_pristine_disk(dev) and
not ceph.is_mapped_luks_device(dev)):