From 1ff7b258f4160f2511e93c7d45bb5e70b5018ba8 Mon Sep 17 00:00:00 2001 From: Scott Barvick Date: Tue, 13 Nov 2018 14:20:06 -0500 Subject: [PATCH] make compatible with both python 2 and 3 by setting the encoding --- lib/ansible/module_utils/network/nso/nso.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/network/nso/nso.py b/lib/ansible/module_utils/network/nso/nso.py index 9fdb5acecb8..96302a55792 100644 --- a/lib/ansible/module_utils/network/nso/nso.py +++ b/lib/ansible/module_utils/network/nso/nso.py @@ -244,7 +244,7 @@ class JsonRpc(object): raise NsoException( 'NSO returned HTTP code {0}, expected 200'.format(resp.status), {}) - resp_body = resp.read() + resp_body = resp.read().decode('utf8') resp_json = json.loads(resp_body) if 'error' in resp_json: