Clean up handling of OSD dump command
This commit is contained in:
parent
190623bdd9
commit
040ca33683
|
@ -213,6 +213,7 @@ def remove_osd(zk_conn, logger, osd_id, osd_obj):
|
||||||
logger.out('Flushing OSD disk with ID {}'.format(osd_id), state='i')
|
logger.out('Flushing OSD disk with ID {}'.format(osd_id), state='i')
|
||||||
osd_string = str()
|
osd_string = str()
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
retcode, stdout, stderr = common.run_os_command('ceph pg dump osds --format json')
|
retcode, stdout, stderr = common.run_os_command('ceph pg dump osds --format json')
|
||||||
dump_string = json.loads(stdout)
|
dump_string = json.loads(stdout)
|
||||||
for osd in dump_string:
|
for osd in dump_string:
|
||||||
|
@ -222,6 +223,8 @@ def remove_osd(zk_conn, logger, osd_id, osd_obj):
|
||||||
if num_pgs > 0:
|
if num_pgs > 0:
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
else:
|
else:
|
||||||
|
raise
|
||||||
|
except:
|
||||||
break
|
break
|
||||||
|
|
||||||
# 3. Stop the OSD process and wait for it to be terminated
|
# 3. Stop the OSD process and wait for it to be terminated
|
||||||
|
|
Loading…
Reference in New Issue