mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
e9a7a741f8
commit
3453dace85
2 changed files with 4 additions and 1 deletions
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 json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from ansible.module_utils._text import to_native
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.six import iteritems
|
from ansible.module_utils.six import iteritems
|
||||||
|
|
||||||
|
@ -93,7 +94,7 @@ def main():
|
||||||
data['finished'] = 0
|
data['finished'] = 0
|
||||||
|
|
||||||
# Fix error: TypeError: exit_json() keywords must be strings
|
# 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)
|
module.exit_json(**data)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue