mirror of
https://github.com/ansible/awx.git
synced 2026-02-22 05:30:18 -03:30
Merge pull request #551 from cchurch/🥓
Include JSON string in temporary inventory script with %r
This commit is contained in:
@@ -680,7 +680,7 @@ class BaseTask(LogErrorsTask):
|
|||||||
path = os.path.join(kwargs['private_data_dir'], 'inventory')
|
path = os.path.join(kwargs['private_data_dir'], 'inventory')
|
||||||
with open(path, 'w') as f:
|
with open(path, 'w') as f:
|
||||||
json_data = json.dumps(instance.inventory.get_script_data(hostvars=True))
|
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)
|
os.chmod(path, stat.S_IRUSR | stat.S_IXUSR)
|
||||||
return path
|
return path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user