From 3cb8a70f04d502f2a3877a7332546999111df5b4 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 2 Nov 2023 23:20:48 -0400 Subject: [PATCH] Add forcing to OSD purge --- node-daemon/pvcnoded/objects/CephInstance.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/node-daemon/pvcnoded/objects/CephInstance.py b/node-daemon/pvcnoded/objects/CephInstance.py index 569d4399..a57b5b36 100644 --- a/node-daemon/pvcnoded/objects/CephInstance.py +++ b/node-daemon/pvcnoded/objects/CephInstance.py @@ -959,9 +959,13 @@ class CephOSDInstance(object): raise Exception # 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( - "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: print("ceph osd purge")