mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-04 21:24:24 -07:00
do not conditionalize this for older Python, fix indentation, better use
of hash iteration.
This commit is contained in:
parent
e64de2ff88
commit
29f985aa2e
1 changed files with 4 additions and 8 deletions
|
@ -49,7 +49,6 @@ author: Michael DeHaan
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import traceback
|
import traceback
|
||||||
import sys
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
|
@ -90,13 +89,10 @@ def main():
|
||||||
if not 'started' in data:
|
if not 'started' in data:
|
||||||
data['finished'] = 1
|
data['finished'] = 1
|
||||||
data['ansible_job_id'] = jid
|
data['ansible_job_id'] = jid
|
||||||
|
|
||||||
# Fix error: TypeError: exit_json() keywords must be strings
|
# Fix error: TypeError: exit_json() keywords must be strings
|
||||||
if sys.version_info[0] == 2 and sys.version_info[1] < 6:
|
data = dict([(str(k), v) for k, v in data.iteritems()])
|
||||||
for k in data.keys():
|
|
||||||
v = data[k]
|
|
||||||
del data[k]
|
|
||||||
data[str(k)] = v
|
|
||||||
module.exit_json(**data)
|
module.exit_json(**data)
|
||||||
|
|
||||||
# this is magic, see lib/ansible/module_common.py
|
# this is magic, see lib/ansible/module_common.py
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue