mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix "TypeError: Object of type map is not JSON serializable" (#223)
Fix TypeError for manageiq_provider module.
This commit is contained in:
parent
546acdaac7
commit
81bf52047a
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
|||
bugfixes:
|
||||
- manageiq_provider - fix serialization error when running on python3 environment.
|
|
@ -571,7 +571,7 @@ def delete_nulls(h):
|
|||
a hash without nulls
|
||||
"""
|
||||
if isinstance(h, list):
|
||||
return map(delete_nulls, h)
|
||||
return [delete_nulls(i) for i in h]
|
||||
if isinstance(h, dict):
|
||||
return dict((k, delete_nulls(v)) for k, v in h.items() if v is not None)
|
||||
|
||||
|
|
Loading…
Reference in a new issue