mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Bugfix: in hosts with python-2.5, hash keys needs flatten string.
This commit is contained in:
parent
89dab0b12c
commit
e64de2ff88
1 changed files with 8 additions and 0 deletions
|
@ -49,6 +49,7 @@ author: Michael DeHaan
|
|||
|
||||
import datetime
|
||||
import traceback
|
||||
import sys
|
||||
|
||||
def main():
|
||||
|
||||
|
@ -89,6 +90,13 @@ def main():
|
|||
if not 'started' in data:
|
||||
data['finished'] = 1
|
||||
data['ansible_job_id'] = jid
|
||||
|
||||
# Fix error: TypeError: exit_json() keywords must be strings
|
||||
if sys.version_info[0] == 2 and sys.version_info[1] < 6:
|
||||
for k in data.keys():
|
||||
v = data[k]
|
||||
del data[k]
|
||||
data[str(k)] = v
|
||||
module.exit_json(**data)
|
||||
|
||||
# this is magic, see lib/ansible/module_common.py
|
||||
|
|
Loading…
Reference in a new issue