mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
use to_text instead of str in async_status (#45990)
* use to_text instead of str in async_status * used to_native instead as per feedback
This commit is contained in:
2
changelogs/fragments/async_statys_pyx_compat_fix.yml
Normal file
2
changelogs/fragments/async_statys_pyx_compat_fix.yml
Normal file
@@ -0,0 +1,2 @@
|
||||
bugfixes:
|
||||
- use to_text (py2/3 safe) instead of str for 'textualizing' intput in async_status
|
||||
@@ -42,6 +42,7 @@ author:
|
||||
import json
|
||||
import os
|
||||
|
||||
from ansible.module_utils._text import to_native
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
@@ -93,7 +94,7 @@ def main():
|
||||
data['finished'] = 0
|
||||
|
||||
# Fix error: TypeError: exit_json() keywords must be strings
|
||||
data = dict([(str(k), v) for k, v in iteritems(data)])
|
||||
data = dict([(to_native(k), v) for k, v in iteritems(data)])
|
||||
|
||||
module.exit_json(**data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user