mirror of
https://github.com/ansible/awx.git
synced 2026-02-26 15:36:04 -03:30
Merge pull request #2955 from ryanpetrello/fix-2951
write custom inventory scripts to AWX_PRIVATE_DATA_DIR
This commit is contained in:
@@ -2163,8 +2163,7 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
elif src == 'scm':
|
elif src == 'scm':
|
||||||
args.append(inventory_update.get_actual_source_path())
|
args.append(inventory_update.get_actual_source_path())
|
||||||
elif src == 'custom':
|
elif src == 'custom':
|
||||||
runpath = tempfile.mkdtemp(prefix='awx_inventory_', dir=settings.AWX_PROOT_BASE_PATH)
|
handle, path = tempfile.mkstemp(dir=kwargs['private_data_dir'])
|
||||||
handle, path = tempfile.mkstemp(dir=runpath)
|
|
||||||
f = os.fdopen(handle, 'w')
|
f = os.fdopen(handle, 'w')
|
||||||
if inventory_update.source_script is None:
|
if inventory_update.source_script is None:
|
||||||
raise RuntimeError('Inventory Script does not exist')
|
raise RuntimeError('Inventory Script does not exist')
|
||||||
@@ -2173,7 +2172,6 @@ class RunInventoryUpdate(BaseTask):
|
|||||||
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
os.chmod(path, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
|
||||||
args.append(path)
|
args.append(path)
|
||||||
args.append("--custom")
|
args.append("--custom")
|
||||||
self.cleanup_paths.append(runpath)
|
|
||||||
args.append('-v%d' % inventory_update.verbosity)
|
args.append('-v%d' % inventory_update.verbosity)
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
args.append('--traceback')
|
args.append('--traceback')
|
||||||
|
|||||||
Reference in New Issue
Block a user