-
Notifications
You must be signed in to change notification settings - Fork 42
Open
Description
The fortigate supports non utf-8 characters, suggestion to replace these when formatting response:
def formatresponse(self, res, vdom=None):
LOG.debug("formating response")
self.logging(res)
# Generic way to format the return from FortiAPI
# If vdom is global the resp is a dict of resp (even 1)
# 1 per vdom we check only the first one here (might need a more
# complex check)
if vdom == "global":
resp = json.loads(res.content.decode('utf-8', errors='replace'))[0]
resp['vdom'] = "global"
else:
LOG.debug("content res: %s", res.content)
resp = json.loads(res.content.decode('utf-8', errors='replace'))
return resp
Metadata
Metadata
Assignees
Labels
No labels