Skip to content

Commit

Permalink
Merge pull request #169 from archerwen/main
Browse files Browse the repository at this point in the history
change the rest resp as json format
  • Loading branch information
mraineri authored Dec 24, 2024
2 parents 1419808 + 5c43a93 commit 49767f2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/redfish/rest/v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -950,12 +950,16 @@ def _rest_request(self, path, method='GET', args=None, body=None,
headerstr += '\t' + header[0] + ': ' + header[1] + '\n'

try:
try:
restrespstr = json.dumps(json.loads(restresp.read), indent=4)
except:
restrespstr = restresp.read
LOGGER.debug('HTTP RESPONSE for %s:\nCode: %s\n\nHeaders:\n' \
'%s\nBody Response of %s: %s\n'%\
'%s\nBody Response of %s:\n%s\n'%\
(restresp.request.path,
str(restresp._http_response.status_code)+ ' ' + \
restresp._http_response.reason,
headerstr, restresp.request.path, restresp.read))
headerstr, restresp.request.path, restrespstr))
except:
LOGGER.debug('HTTP RESPONSE:\nCode:%s', restresp)
else:
Expand Down

0 comments on commit 49767f2

Please sign in to comment.