Merge "[API] Nodes get KeyError: 'Members'"
This commit is contained in:
commit
fad73d727e
@ -159,7 +159,10 @@ def urls2list(url):
|
|||||||
# This will extract the url values from @odata.id inside Members
|
# This will extract the url values from @odata.id inside Members
|
||||||
resp = send_request(url)
|
resp = send_request(url)
|
||||||
respdata = resp.json()
|
respdata = resp.json()
|
||||||
|
if 'Members' in respdata:
|
||||||
return [u['@odata.id'] for u in respdata['Members']]
|
return [u['@odata.id'] for u in respdata['Members']]
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
def extract_val(data, path):
|
def extract_val(data, path):
|
||||||
@ -397,7 +400,8 @@ def nodes_list(count=None, filters={}):
|
|||||||
if "Memory" in node:
|
if "Memory" in node:
|
||||||
ram = node["Memory"]["TotalSystemMemoryGiB"]
|
ram = node["Memory"]["TotalSystemMemoryGiB"]
|
||||||
|
|
||||||
if "EthernetInterfaces" in node["Links"]:
|
if "EthernetInterfaces" in node["Links"] and node[
|
||||||
|
"Links"]["EthernetInterfaces"]:
|
||||||
nw = len(node["Links"]["EthernetInterfaces"])
|
nw = len(node["Links"]["EthernetInterfaces"])
|
||||||
|
|
||||||
bmcip = "127.0.0.1" # system['Oem']['Dell_G5MC']['BmcIp']
|
bmcip = "127.0.0.1" # system['Oem']['Dell_G5MC']['BmcIp']
|
||||||
|
Loading…
Reference in New Issue
Block a user