mirror of
https://github.com/ansible/awx.git
synced 2026-05-10 02:47:36 -02:30
allow the bundled ansible virtualenv to be selected on JT/Proj
see: https://github.com/ansible/awx/issues/34
This commit is contained in:
@@ -173,11 +173,15 @@ def test_extract_ansible_vars():
|
||||
|
||||
|
||||
def test_get_custom_venv_choices():
|
||||
assert common.get_custom_venv_choices() == []
|
||||
bundled_venv = os.path.join(settings.BASE_VENV_PATH, 'ansible', '')
|
||||
assert common.get_custom_venv_choices() == [bundled_venv]
|
||||
|
||||
with TemporaryDirectory(dir=settings.BASE_VENV_PATH) as temp_dir:
|
||||
with TemporaryDirectory(dir=settings.BASE_VENV_PATH, prefix='tmp') as temp_dir:
|
||||
os.makedirs(os.path.join(temp_dir, 'bin', 'activate'))
|
||||
assert common.get_custom_venv_choices() == [os.path.join(temp_dir, '')]
|
||||
assert sorted(common.get_custom_venv_choices()) == [
|
||||
bundled_venv,
|
||||
os.path.join(temp_dir, '')
|
||||
]
|
||||
|
||||
|
||||
def test_region_sorting():
|
||||
|
||||
@@ -928,7 +928,7 @@ def get_custom_venv_choices():
|
||||
return [
|
||||
os.path.join(custom_venv_path, x.decode('utf-8'), '')
|
||||
for x in os.listdir(custom_venv_path)
|
||||
if x not in ('awx', 'ansible') and
|
||||
if x != 'awx' and
|
||||
os.path.isdir(os.path.join(custom_venv_path, x)) and
|
||||
os.path.exists(os.path.join(custom_venv_path, x, 'bin', 'activate'))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user