DMTF/Redfish-Mockup-Creator

Version of rfTransport returns None

tomasg2012 opened this issue · 0 comments

Call to redfishTransport on line 703 returns None on a specific condition involving paged payloads, appearing to miss a fallback condition and returning absolutely nothing, which normally always returns a tuple, causing an exception.

#DB5: Transport.ProcessRequest: url=https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=50
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=100
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=150
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=200
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=250
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=300
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=350
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=400
#REQUEST: Transport:SendRecv:    GET https://10.36.0.117/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog?$skip=450
 File "redfishMockupCreate.py", line xxx, in readResourceMkdirCreateIndxFile
   rc,r,j,d=rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', rootUrl, relPath=absPath, jsonData=jsonData )
TypeError: 'NoneType' object is not iterable
... [[[Normally terminates here]]]
redfishMockupCreate: ERROR:readResourceMkdirCreateIndxFile: Error reading resource: link:{'@odata.id': '/redfish/v1/Managers/iDRAC.Embedded.1/Logs/Lclog'}

A patch on line 703 to allow progress past this pt and print this line, but requires updating the transport, see if this bug exists in the original codebase. Patch the offending line with the following will fail without terminating.

retval = rft.rftSendRecvRequest(rft.AUTHENTICATED_API, 'GET', rootUrl, relPath=absPath, jsonData=jsonData)
rc, r, j, d = retval if retval is not None else (1, None, False, None)