mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Revert 9b95cc27c4.
We do not want to create a new setting for a on-Tower-host global collection path at this time.
This commit is contained in:
@@ -444,7 +444,6 @@ class TestGenericRun():
|
||||
settings.AWX_PROOT_HIDE_PATHS = ['/AWX_PROOT_HIDE_PATHS1', '/AWX_PROOT_HIDE_PATHS2']
|
||||
settings.ANSIBLE_VENV_PATH = '/ANSIBLE_VENV_PATH'
|
||||
settings.AWX_VENV_PATH = '/AWX_VENV_PATH'
|
||||
settings.AWX_ANSIBLE_COLLECTIONS_PATHS = ['/AWX_COLLECTION_PATH1', '/AWX_COLLECTION_PATH2']
|
||||
|
||||
process_isolation_params = task.build_params_process_isolation(job, private_data_dir, cwd)
|
||||
assert True is process_isolation_params['process_isolation']
|
||||
@@ -454,10 +453,6 @@ class TestGenericRun():
|
||||
"The per-job private data dir should be in the list of directories the user can see."
|
||||
assert cwd in process_isolation_params['process_isolation_show_paths'], \
|
||||
"The current working directory should be in the list of directories the user can see."
|
||||
assert '/AWX_COLLECTION_PATH1' in process_isolation_params['process_isolation_show_paths'], \
|
||||
"AWX global collection directory 1 of 2 should get added to the list of directories the user can see."
|
||||
assert '/AWX_COLLECTION_PATH2' in process_isolation_params['process_isolation_show_paths'], \
|
||||
"AWX global collection directory 2 of 2 should get added to the list of directories the user can see."
|
||||
|
||||
for p in [settings.AWX_PROOT_BASE_PATH,
|
||||
'/etc/tower',
|
||||
@@ -517,20 +512,6 @@ class TestGenericRun():
|
||||
env = task.build_env(job, private_data_dir)
|
||||
assert env['FOO'] == 'BAR'
|
||||
|
||||
def test_awx_task_env_respects_ansible_collections_paths(self, patch_Job, private_data_dir):
|
||||
job = Job(project=Project(), inventory=Inventory())
|
||||
|
||||
task = tasks.RunJob()
|
||||
task._write_extra_vars_file = mock.Mock()
|
||||
|
||||
with mock.patch('awx.main.tasks.settings.AWX_ANSIBLE_COLLECTIONS_PATHS', ['/AWX_COLLECTION_PATH']):
|
||||
with mock.patch('awx.main.tasks.settings.AWX_TASK_ENV', {'ANSIBLE_COLLECTIONS_PATHS': '/MY_COLLECTION1:/MY_COLLECTION2'}):
|
||||
env = task.build_env(job, private_data_dir)
|
||||
used_paths = env['ANSIBLE_COLLECTIONS_PATHS'].split(':')
|
||||
assert used_paths[-1].endswith('/requirements_collections')
|
||||
used_paths.pop()
|
||||
assert used_paths == ['/MY_COLLECTION1', '/MY_COLLECTION2', '/AWX_COLLECTION_PATH']
|
||||
|
||||
def test_valid_custom_virtualenv(self, patch_Job, private_data_dir):
|
||||
job = Job(project=Project(), inventory=Inventory())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user