From 416bc3c0409e6098e701a9f944af5060e691f887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20Angel=20Mu=C3=B1oz=20Gonz=C3=A1lez?= Date: Tue, 3 Sep 2019 16:16:40 +0200 Subject: [PATCH] Update fortios.py --- lib/ansible/module_utils/network/fortios/fortios.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/ansible/module_utils/network/fortios/fortios.py b/lib/ansible/module_utils/network/fortios/fortios.py index ae92e009386..56aee11f49f 100644 --- a/lib/ansible/module_utils/network/fortios/fortios.py +++ b/lib/ansible/module_utils/network/fortios/fortios.py @@ -117,11 +117,11 @@ class FortiOSHandler(object): if status == 200: if vdom == "global": - return json.loads(result_data)[0]['results'] + return json.loads(to_text(result_data))[0]['results'] else: - return json.loads(result_data)['results'] + return json.loads(to_text(result_data))['results'] else: - return json.loads(result_data) + return json.loads(to_text(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)[0] + resp = json.loads(to_text(res))[0] resp['vdom'] = "global" else: - resp = json.loads(res) + resp = json.loads(to_text(res)) return resp # BEGIN DEPRECATED