mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-01 19:54:24 -07:00
Make async work on python 3 (#4583)
Since dict no longer have a iteritems method, we have to use six to support python 2 and 3.
This commit is contained in:
parent
f4158304ac
commit
25fd3928b6
1 changed files with 2 additions and 1 deletions
|
@ -50,6 +50,7 @@ author:
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import traceback
|
import traceback
|
||||||
|
from ansible.module_utils.six import iteritems
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
@ -95,7 +96,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 data.iteritems()])
|
data = dict([(str(k), v) for k, v in iteritems(data)])
|
||||||
|
|
||||||
module.exit_json(**data)
|
module.exit_json(**data)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue