fix list data

This commit is contained in:
Alex_geth
2023-08-01 10:14:51 +03:00
parent 740271b2f2
commit 66e72a3d3b

View File

@@ -1924,7 +1924,7 @@ class DecortController(object):
# Parse response to see if a account matching arg_account_name is found in the output # Parse response to see if a account matching arg_account_name is found in the output
# If it is found, assign its ID to the return variable and copy dictionary with the facts # If it is found, assign its ID to the return variable and copy dictionary with the facts
accounts_list = json.loads(api_resp.content.decode('utf8')) accounts_list = json.loads(api_resp.content.decode('utf8'))
for runner in accounts_list: for runner in accounts_list['data']:
if runner['name'] == account_name: if runner['name'] == account_name:
# get detailed information about the account from "accounts/get" call as # get detailed information about the account from "accounts/get" call as
# "accounts/list" does not return all necessary fields # "accounts/list" does not return all necessary fields
@@ -2029,7 +2029,7 @@ class DecortController(object):
if api_resp.status_code == 200: if api_resp.status_code == 200:
ret_gpu_list = json.loads(api_resp.content.decode('utf8')) ret_gpu_list = json.loads(api_resp.content.decode('utf8'))
return ret_gpu_list return ret_gpu_list['data']
################################### ###################################
# Workflow callback stub methods - not fully implemented yet # Workflow callback stub methods - not fully implemented yet
@@ -2087,7 +2087,7 @@ class DecortController(object):
if location_code == "" and locations: if location_code == "" and locations:
ret_gid = locations['data'][0]['gid'] ret_gid = locations['data'][0]['gid']
else: else:
for runner in locations: for runner in locations['data']:
if runner['locationCode'] == location_code: if runner['locationCode'] == location_code:
# location code matches # location code matches
ret_gid = runner['gid'] ret_gid = runner['gid']
@@ -3037,7 +3037,7 @@ class DecortController(object):
return all_rules return all_rules
filtered_rules = [] filtered_rules = []
for runner in all_rules: for runner in all_rules['data']:
if runner['vmId'] == comp_id: if runner['vmId'] == comp_id:
filtered_rules.append(runner) filtered_rules.append(runner)