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
cee7473df6
commit
6dd2bc2bff
1 changed files with 2 additions and 1 deletions
|
@ -50,6 +50,7 @@ author:
|
|||
|
||||
import datetime
|
||||
import traceback
|
||||
from ansible.module_utils.six import iteritems
|
||||
|
||||
def main():
|
||||
|
||||
|
@ -95,7 +96,7 @@ def main():
|
|||
data['finished'] = 0
|
||||
|
||||
# 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)
|
||||
|
||||
|
|
Loading…
Reference in a new issue