From b6491f1bcdb10b6bf2bbf883656f6fa4e24d4480 Mon Sep 17 00:00:00 2001 From: oviner Date: Tue, 6 Feb 2024 10:39:05 +0200 Subject: [PATCH] fix code Signed-off-by: oviner --- ocs_ci/deployment/ibmcloud.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ocs_ci/deployment/ibmcloud.py b/ocs_ci/deployment/ibmcloud.py index 38ea0b1379ab..fddf80068529 100644 --- a/ocs_ci/deployment/ibmcloud.py +++ b/ocs_ci/deployment/ibmcloud.py @@ -405,6 +405,7 @@ def _delete_resources(resources, ignore_errors=False): exec_cmd(delete_cmd) if resource_group: + self.get_resource_id(resource_group) leftovers = _get_resources(resource_group) if not leftovers: logger.info("No leftovers found") @@ -500,6 +501,16 @@ def configure_cloud_credential_operator(): # # return json.loads(proc.stdout) + def get_resource_id(self, resource_group): + cmd = "ibmcloud resource groups --output json" + proc = exec_cmd(cmd) + logger.info("Retrieving cluster resource group") + resource_data = json.loads(proc.stdout) + for group in resource_data: + if group["name"] == resource_group: + return group["id"] + return False + def get_created_time(self, resource_group): """ Get