Merge branch 'BANS-300' into 'dev_rc-5.2.6'

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

See merge request rudecs/dev/decort-ansible!46
rc-5.3.0^2
commit 38f11ee480

@ -1438,7 +1438,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