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
pull/46851/merge
Brian Coca 6 years ago committed by GitHub
parent e9a7a741f8
commit 3453dace85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save