mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
make sure obj is dict
This commit is contained in:
parent
afa04f564a
commit
88087847e2
1 changed files with 5 additions and 1 deletions
|
@ -137,7 +137,11 @@ def return_obj_string_safe(response, to_encoding="utf-8"):
|
|||
return_obj_string_safe
|
||||
encoding type to use, defaulted to "utf-8"
|
||||
"""
|
||||
if "return" in response.keys() and "return" in response["return"].keys():
|
||||
if (
|
||||
isinstance(response, dict)
|
||||
and "return" in response.keys()
|
||||
and "return" in response["return"].keys()
|
||||
):
|
||||
if isinstance(response["return"]["return"], (bytes, bytearray)):
|
||||
response["return"]["return"] = response["return"]["return"].decode(
|
||||
to_encoding, "strict"
|
||||
|
|
Loading…
Add table
Reference in a new issue