diff --git a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 index f409cdc85a..eeb4687b00 100755 --- a/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 +++ b/roles/copr/backend/templates/resalloc/ibm-cloud-vm.j2 @@ -84,10 +84,9 @@ def bind_floating_ip(service, instance_id, opts): def allocate_and_assign_ip(service, opts): """ - curl -X POST "$vpc_api_endpoint/v1/floating_ips?version=$api_version&generation=2" \ - -H "$iam_token" \ -' + Allocate and assign a Floating IP to an existing machine in one call. """ + url = SERVICE_URL + "/floating_ips" headers = { "Accept": "application/json", @@ -97,14 +96,12 @@ def allocate_and_assign_ip(service, opts): 'version': "2022-01-18", 'generation': "2", } - data = { "name": opts.instance_name, "target": { "id": opts.instance_created["primary_network_interface"]["id"], }, } - response = requests.post(url, headers=headers, json=data, params=params) assert response.status_code == 201 opts.allocated_floating_ip_id = response.json()["id"]