From ae4bde8500f2439f926cd05f83ba27b57792c30d Mon Sep 17 00:00:00 2001 From: "Miguel A. Munoz" Date: Tue, 3 Sep 2019 17:40:14 +0200 Subject: [PATCH] Suggested changes by Qalthos --- lib/ansible/module_utils/network/fortios/fortios.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/module_utils/network/fortios/fortios.py b/lib/ansible/module_utils/network/fortios/fortios.py index ff14788fb19..3984f8dbe34 100644 --- a/lib/ansible/module_utils/network/fortios/fortios.py +++ b/lib/ansible/module_utils/network/fortios/fortios.py @@ -253,7 +253,7 @@ class AnsibleFortios(object): try: self.forti_device.open() except Exception as e: - self.module.fail_json(msg='Error connecting device. %s' % to_native(e), + self.module.fail_json(msg='Error connecting device. %s' % to_text(e), exception=traceback.format_exc()) def load_config(self, path): @@ -266,7 +266,7 @@ class AnsibleFortios(object): running = f.read() f.close() except IOError as e: - self.module.fail_json(msg='Error reading configuration file. %s' % to_native(e), + self.module.fail_json(msg='Error reading configuration file. %s' % to_text(e), exception=traceback.format_exc()) self.forti_device.load_config(config_text=running, path=path) @@ -276,7 +276,7 @@ class AnsibleFortios(object): self.forti_device.load_config(path=path) except Exception as e: self.forti_device.close() - self.module.fail_json(msg='Error reading running config. %s' % to_native(e), + self.module.fail_json(msg='Error reading running config. %s' % to_text(e), exception=traceback.format_exc()) # set configs in object @@ -302,7 +302,7 @@ class AnsibleFortios(object): f.close() except IOError as e: self.module.fail_json(msg='Error writing configuration file. %s' % - to_native(e), exception=traceback.format_exc()) + to_text(e), exception=traceback.format_exc()) else: try: self.forti_device.commit()