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:
Brian Coca 2018-10-12 10:04:37 -04:00 committed by GitHub
parent e9a7a741f8
commit 3453dace85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- use to_text (py2/3 safe) instead of str for 'textualizing' intput in async_status

View file

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