mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-18 19:00:22 -07:00
updated .decode('utf-8') to to_text()
This commit is contained in:
parent
1ff7b258f4
commit
0f0e976183
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@
|
||||||
|
|
||||||
from ansible.module_utils.basic import env_fallback
|
from ansible.module_utils.basic import env_fallback
|
||||||
from ansible.module_utils.urls import open_url
|
from ansible.module_utils.urls import open_url
|
||||||
|
from ansible.module_utils._text import to_text
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
@ -244,7 +245,7 @@ class JsonRpc(object):
|
||||||
raise NsoException(
|
raise NsoException(
|
||||||
'NSO returned HTTP code {0}, expected 200'.format(resp.status), {})
|
'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)
|
resp_json = json.loads(resp_body)
|
||||||
|
|
||||||
if 'error' in resp_json:
|
if 'error' in resp_json:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue