mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
replace redundant to_native()/to_text() occurrences, batch 7 (#11112)
* replace redundant to_native()/to_text() occurrences, batch 7 * add changelog frag * made changes per review
This commit is contained in:
@@ -58,7 +58,7 @@ class OcapiUtils:
|
||||
use_proxy=True,
|
||||
timeout=self.timeout,
|
||||
)
|
||||
data = json.loads(to_native(resp.read()))
|
||||
data = json.loads(resp.read())
|
||||
headers = {k.lower(): v for (k, v) in resp.info().items()}
|
||||
except HTTPError as e:
|
||||
return {"ret": False, "msg": f"HTTP Error {e.code} on GET request to '{uri}'", "status": e.code}
|
||||
@@ -88,7 +88,7 @@ class OcapiUtils:
|
||||
timeout=self.timeout,
|
||||
)
|
||||
if resp.status != 204:
|
||||
data = json.loads(to_native(resp.read()))
|
||||
data = json.loads(resp.read())
|
||||
else:
|
||||
data = ""
|
||||
headers = {k.lower(): v for (k, v) in resp.info().items()}
|
||||
|
||||
Reference in New Issue
Block a user