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