From d572a9a6020592607d98aa30cea75940428506b0 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Wed, 25 Jul 2018 13:13:17 -0500 Subject: [PATCH] igw: fix image removal during purge We were not passing in the ceph conf info into the rbd image removal command, so if the clustername was not the default igw purge would fail due to the rbd rm command failing. This just fixes the bug by passing in the ceph conf info which has the clustername to use. This fixes Red Hat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1601949 Signed-off-by: Mike Christie --- library/igw_purge.py | 3 ++- roles/ceph-iscsi-gw/library/igw_purge.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/library/igw_purge.py b/library/igw_purge.py index cffc4f434..92e6433a7 100644 --- a/library/igw_purge.py +++ b/library/igw_purge.py @@ -70,7 +70,8 @@ def delete_group(module, image_list, cfg): def delete_rbd(module, rbd_path): logger.debug("issuing delete for {}".format(rbd_path)) - rm_cmd = 'rbd --no-progress rm {}'.format(rbd_path) + rm_cmd = 'rbd --no-progress --conf {} rm {}'.format(settings.config.cephconf, + rbd_path) rc, rm_out, err = module.run_command(rm_cmd, use_unsafe_shell=True) logger.debug("delete RC = {}, {}".format(rc, rm_out, err)) diff --git a/roles/ceph-iscsi-gw/library/igw_purge.py b/roles/ceph-iscsi-gw/library/igw_purge.py index cffc4f434..92e6433a7 100644 --- a/roles/ceph-iscsi-gw/library/igw_purge.py +++ b/roles/ceph-iscsi-gw/library/igw_purge.py @@ -70,7 +70,8 @@ def delete_group(module, image_list, cfg): def delete_rbd(module, rbd_path): logger.debug("issuing delete for {}".format(rbd_path)) - rm_cmd = 'rbd --no-progress rm {}'.format(rbd_path) + rm_cmd = 'rbd --no-progress --conf {} rm {}'.format(settings.config.cephconf, + rbd_path) rc, rm_out, err = module.run_command(rm_cmd, use_unsafe_shell=True) logger.debug("delete RC = {}, {}".format(rc, rm_out, err))