mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 23:16:01 -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')
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user