Clear the non-pristine blocked status

We need to clear the blocked status "non-pristine device detected ..."
when there is no non-pristine device anymore

Change-Id: I2f31eb9c08be186c08554122c2a160bbcbf2c389
Signed-off-by: dongdong tao <dongdong.tao@canonical.com>
Closes-Bug: #1810508
This commit is contained in:
dongdong tao 2019-01-04 20:25:15 +08:00
parent eec8464e93
commit 03247be719
1 changed files with 11 additions and 0 deletions

View File

@ -722,6 +722,17 @@ def assess_status():
else:
status_set('active',
'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)):
if (not ceph.is_active_bluestore_device(dev) and
not ceph.is_pristine_disk(dev)):
pristine = False
break
if pristine:
status_set('active',
'Unit is ready ({} OSD)'.format(len(running_osds)))
@hooks.hook('update-status')