Skip to content

Commit

Permalink
use to_text instead of str in async_status (ansible#45990)
Browse files Browse the repository at this point in the history
* use to_text instead of str in async_status

* used to_native instead as per feedback
  • Loading branch information
bcoca authored Oct 12, 2018
1 parent e9a7a74 commit 3453dac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/async_statys_pyx_compat_fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- use to_text (py2/3 safe) instead of str for 'textualizing' intput in async_status
3 changes: 2 additions & 1 deletion lib/ansible/modules/utilities/logic/async_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 3453dac

Please sign in to comment.