diff --git a/awx/main/tasks.py b/awx/main/tasks.py index b27ce0e967..78d832a97d 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1794,6 +1794,11 @@ class RunInventoryUpdate(BaseTask): section = 'cache' cp.add_section(section) cp.set(section, 'max_age', "0") + cache_path = tempfile.mkdtemp( + prefix='cloudforms_cache', + dir=kwargs.get('private_data_dir', None) + ) + cp.set(section, 'path', cache_path) elif inventory_update.source == 'azure_rm': section = 'azure' diff --git a/awx/main/tests/unit/test_tasks.py b/awx/main/tests/unit/test_tasks.py index ccd49a5094..28d24f62cc 100644 --- a/awx/main/tests/unit/test_tasks.py +++ b/awx/main/tests/unit/test_tasks.py @@ -1473,6 +1473,10 @@ class TestInventoryUpdateCredentials(TestJobExecution): assert config.get('cloudforms', 'username') == 'bob' assert config.get('cloudforms', 'password') == 'secret' assert config.get('cloudforms', 'ssl_verify') == 'false' + + cache_path = config.get('cache', 'path') + assert cache_path.startswith(env['AWX_PRIVATE_DATA_DIR']) + assert os.path.isdir(cache_path) return ['successful', 0] self.run_pexpect.side_effect = run_pexpect_side_effect