From 0f0e9761834b4a0f73aecff092da19ad721948e6 Mon Sep 17 00:00:00 2001 From: Scott Barvick Date: Wed, 14 Nov 2018 14:19:01 -0500 Subject: [PATCH] updated .decode('utf-8') to to_text() --- lib/ansible/module_utils/network/nso/nso.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/network/nso/nso.py b/lib/ansible/module_utils/network/nso/nso.py index 96302a55792..6a01d6100fb 100644 --- a/lib/ansible/module_utils/network/nso/nso.py +++ b/lib/ansible/module_utils/network/nso/nso.py @@ -21,6 +21,7 @@ from ansible.module_utils.basic import env_fallback from ansible.module_utils.urls import open_url +from ansible.module_utils._text import to_text import json import re @@ -244,7 +245,7 @@ class JsonRpc(object): raise NsoException( 'NSO returned HTTP code {0}, expected 200'.format(resp.status), {}) - resp_body = resp.read().decode('utf8') + resp_body = to_text(resp.read()) resp_json = json.loads(resp_body) if 'error' in resp_json: