From c77da1641ed242f8fc46d2f32db45b1e9e8ddbdd Mon Sep 17 00:00:00 2001 From: Jakub Kadlcik Date: Fri, 26 Aug 2022 03:58:09 +0200 Subject: [PATCH] copr: actually, the highest possible limit is 100 ibm_cloud_sdk_core.api_exception.ApiException: Error: The `limit` parameter is invalid, it must be an integer between 1 and 100., Code: 400 --- roles/copr/backend/templates/resalloc/ibm-cloud-list-vms.j2 | 4 +++- roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/roles/copr/backend/templates/resalloc/ibm-cloud-list-vms.j2 b/roles/copr/backend/templates/resalloc/ibm-cloud-list-vms.j2 index 631062f197..9cfb84e02a 100755 --- a/roles/copr/backend/templates/resalloc/ibm-cloud-list-vms.j2 +++ b/roles/copr/backend/templates/resalloc/ibm-cloud-list-vms.j2 @@ -11,7 +11,9 @@ from ibm_cloud_sdk_core.authenticators import IAMAuthenticator DEFAULT_TOKEN_FILE = "{{ ibmcloud_token_file }}" SERVICE_URL = "https://jp-tok.iaas.cloud.ibm.com/v1" -LIMIT = 999 + +# Using the highest value possible +LIMIT = 100 def _get_arg_parser(): diff --git a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 index 1fbfb6d43f..b41ecc592c 100755 --- a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 +++ b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 @@ -253,7 +253,7 @@ def delete_instance_attempt(service, instance_name, opts): # Query all volumes only after already potentionaly deleting an instance. # The volumes might have been deleted automatically volume_ids = [] - volumes = service.list_volumes(limit=999).result["volumes"] + volumes = service.list_volumes(limit=100).result["volumes"] for volume in volumes: if volume["name"].startswith(instance_name): volume_ids.append(volume["id"])