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:
Michael Scherer 2016-08-31 17:18:54 +02:00 committed by Toshio Kuratomi
parent cee7473df6
commit 6dd2bc2bff

View file

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