Add forcing to OSD purge

This commit is contained in:
Joshua Boniface 2023-11-02 23:20:48 -04:00
parent 44d2f98e75
commit 3cb8a70f04
1 changed files with 6 additions and 2 deletions

View File

@ -959,9 +959,13 @@ class CephOSDInstance(object):
raise Exception raise Exception
# 5. Purge the OSD from Ceph # 5. Purge the OSD from Ceph
logger.out("Purging OSD {}".format(osd_id), state="i") logger.out("Purging OSD {osd_id}", state="i")
if force_flag:
force_arg = "--force"
else:
force_arg = ""
retcode, stdout, stderr = common.run_os_command( retcode, stdout, stderr = common.run_os_command(
"ceph osd purge {} --yes-i-really-mean-it".format(osd_id) f"ceph osd purge {osd_id} {force_arg} --yes-i-really-mean-it"
) )
if retcode: if retcode:
print("ceph osd purge") print("ceph osd purge")