Fix logging error in GET systems
This commit ensures that a value exists for network interfaces of a system before trying to log the value. Change-Id: Id6f7d9fb3e8ba9f4349c0d02d83574300f591693 Closes-bug: #1639368
This commit is contained in:
parent
da241b473f
commit
c766f2ab1a
@ -154,9 +154,9 @@ def node_nw_details(nodeurl):
|
|||||||
# this extracts the total nw interfaces and returns as a string
|
# this extracts the total nw interfaces and returns as a string
|
||||||
resp = send_request(nodeurl + "/EthernetInterfaces")
|
resp = send_request(nodeurl + "/EthernetInterfaces")
|
||||||
respbody = resp.json()
|
respbody = resp.json()
|
||||||
nwi = extract_val(respbody, "Members@odata.count")
|
nwi = str(extract_val(respbody, "Members@odata.count", "0"))
|
||||||
LOG.debug(" Total NW for node %s : %d " % (nodeurl, nwi))
|
LOG.debug(" Total NW for node %s : %s " % (nodeurl, nwi))
|
||||||
return str(nwi) if nwi else "0"
|
return nwi
|
||||||
|
|
||||||
|
|
||||||
def node_storage_details(nodeurl):
|
def node_storage_details(nodeurl):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user