fix "TypeError: Object of type map is not JSON serializable" (#223)

Fix TypeError for manageiq_provider module.
This commit is contained in:
kenchrcum 2020-04-24 07:56:12 +02:00 committed by GitHub
commit 81bf52047a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -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)