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:
Nate Potter 2016-11-04 15:08:52 -07:00
parent da241b473f
commit c766f2ab1a

View File

@ -154,9 +154,9 @@ def node_nw_details(nodeurl):
# this extracts the total nw interfaces and returns as a string
resp = send_request(nodeurl + "/EthernetInterfaces")
respbody = resp.json()
nwi = extract_val(respbody, "Members@odata.count")
LOG.debug(" Total NW for node %s : %d " % (nodeurl, nwi))
return str(nwi) if nwi else "0"
nwi = str(extract_val(respbody, "Members@odata.count", "0"))
LOG.debug(" Total NW for node %s : %s " % (nodeurl, nwi))
return nwi
def node_storage_details(nodeurl):