mirror of
https://github.com/ansible/awx.git
synced 2026-01-18 05:01:19 -03:30
Output repr() of JSON in temporary inventory script to prevent Python from devouring escape sequences.
This commit is contained in:
parent
0579db1162
commit
863b5e2e8e
@ -680,7 +680,7 @@ class BaseTask(LogErrorsTask):
|
||||
path = os.path.join(kwargs['private_data_dir'], 'inventory')
|
||||
with open(path, 'w') as f:
|
||||
json_data = json.dumps(instance.inventory.get_script_data(hostvars=True))
|
||||
f.write('#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nprint """%s"""\n' % json_data)
|
||||
f.write('#! /usr/bin/env python\n# -*- coding: utf-8 -*-\nprint %r\n' % json_data)
|
||||
os.chmod(path, stat.S_IRUSR | stat.S_IXUSR)
|
||||
return path
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user