Fix access to API response image list in DecortController.virt_image_find method

rc-5.3.0^2
Dmitriy Smirnov 9 months ago
parent 57dba89b5a
commit a39ab95c1f

@ -1439,7 +1439,7 @@ class DecortController(object):
api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/image/list", api_params) api_resp = self.decort_api_call(requests.post, "/restmachine/cloudapi/image/list", api_params)
# On success the above call will return here. On error it will abort execution by calling fail_json. # On success the above call will return here. On error it will abort execution by calling fail_json.
images_list = json.loads(api_resp.content.decode('utf8')) images_list = json.loads(api_resp.content.decode('utf8'))
for image_record in images_list: for image_record in images_list['data']:
if image_record['name'] == virt_name and image_record['status'] == "CREATED" and image_record['type'] == "virtual": if image_record['name'] == virt_name and image_record['status'] == "CREATED" and image_record['type'] == "virtual":
if sepid == 0 and pool == "": if sepid == 0 and pool == "":
# if no filtering by SEP ID or pool name is requested, return the first match # if no filtering by SEP ID or pool name is requested, return the first match

Loading…
Cancel
Save