mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Updated as per reviewers comments
This commit is contained in:
parent
a1f54d9f27
commit
8c60ddb291
2 changed files with 6 additions and 2 deletions
|
@ -1 +1 @@
|
|||
Issue #62477: Check NamedLoadedContext mapping is not None, before attempting to create a dictory with it
|
||||
Check NamedLoadedContext mapping is not None, before attempting to create a dictory with it
|
||||
|
|
|
@ -4,6 +4,7 @@ encrypted keys to general payload dynamics and packaging, these happen
|
|||
in here
|
||||
"""
|
||||
|
||||
import collections.abc
|
||||
import datetime
|
||||
import gc
|
||||
import logging
|
||||
|
@ -15,6 +16,7 @@ import salt.utils.msgpack
|
|||
import salt.utils.stringutils
|
||||
from salt.defaults import _Constant
|
||||
from salt.exceptions import SaltDeserializationError, SaltReqTimeoutError
|
||||
from salt.loader.context import NamedLoaderContext
|
||||
from salt.utils.data import CaseInsensitiveDict
|
||||
|
||||
try:
|
||||
|
@ -163,10 +165,12 @@ def dumps(msg, use_bin_type=False):
|
|||
return tuple(obj)
|
||||
elif isinstance(obj, CaseInsensitiveDict):
|
||||
return dict(obj)
|
||||
elif isinstance(obj, salt.loader.context.NamedLoaderContext):
|
||||
elif isinstance(obj, NamedLoaderContext):
|
||||
if obj.value() is None:
|
||||
return {}
|
||||
return dict(obj)
|
||||
elif isinstance(obj, collections.abc.MutableMapping):
|
||||
return dict(obj)
|
||||
# Nothing known exceptions found. Let msgpack raise its own.
|
||||
return obj
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue