Fix Decode Bug in Py3

pull/61691/head
Miguel A. Munoz 6 years ago
parent 74e6c460b4
commit 87642ac93e

@ -117,11 +117,11 @@ class FortiOSHandler(object):
if status == 200:
if vdom == "global":
return json.loads(result_data.decode('utf-8'))[0]['results']
return json.loads(result_data)[0]['results']
else:
return json.loads(result_data.decode('utf-8'))['results']
return json.loads(result_data)['results']
else:
return json.loads(result_data.decode('utf-8'))
return json.loads(result_data)
def get_mkeyname(self, path, name, vdom=None):
schema = self.schema(path, name, vdom=vdom)
@ -200,10 +200,10 @@ class FortiOSHandler(object):
def formatresponse(self, res, vdom=None):
if vdom == "global":
resp = json.loads(res.decode('utf-8'))[0]
resp = json.loads(res)[0]
resp['vdom'] = "global"
else:
resp = json.loads(res.decode('utf-8'))
resp = json.loads(res)
return resp
# BEGIN DEPRECATED

Loading…
Cancel
Save