mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Check NamedLoaderContext obj is not None, before creating a dictionary
This commit is contained in:
parent
196023a086
commit
a1f54d9f27
2 changed files with 4 additions and 2 deletions
1
changelog/62477.fixed.md
Normal file
1
changelog/62477.fixed.md
Normal file
|
@ -0,0 +1 @@
|
|||
Issue #62477: Check NamedLoadedContext mapping is not None, before attempting to create a dictory with it
|
|
@ -4,7 +4,6 @@ encrypted keys to general payload dynamics and packaging, these happen
|
|||
in here
|
||||
"""
|
||||
|
||||
import collections.abc
|
||||
import datetime
|
||||
import gc
|
||||
import logging
|
||||
|
@ -164,7 +163,9 @@ def dumps(msg, use_bin_type=False):
|
|||
return tuple(obj)
|
||||
elif isinstance(obj, CaseInsensitiveDict):
|
||||
return dict(obj)
|
||||
elif isinstance(obj, collections.abc.MutableMapping):
|
||||
elif isinstance(obj, salt.loader.context.NamedLoaderContext):
|
||||
if obj.value() is None:
|
||||
return {}
|
||||
return dict(obj)
|
||||
# Nothing known exceptions found. Let msgpack raise its own.
|
||||
return obj
|
||||
|
|
Loading…
Add table
Reference in a new issue