mirror of
https://github.com/ansible/awx.git
synced 2026-03-13 23:17:32 -02:30
Merge pull request #6993 from gamuniz/venv_permission_fix
added try/except to virtual env Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
@@ -1010,14 +1010,17 @@ def get_custom_venv_choices(custom_paths=None):
|
|||||||
custom_venv_choices = []
|
custom_venv_choices = []
|
||||||
|
|
||||||
for custom_venv_path in all_venv_paths:
|
for custom_venv_path in all_venv_paths:
|
||||||
if os.path.exists(custom_venv_path):
|
try:
|
||||||
custom_venv_choices.extend([
|
if os.path.exists(custom_venv_path):
|
||||||
os.path.join(custom_venv_path, x, '')
|
custom_venv_choices.extend([
|
||||||
for x in os.listdir(custom_venv_path)
|
os.path.join(custom_venv_path, x, '')
|
||||||
if x != 'awx' and
|
for x in os.listdir(custom_venv_path)
|
||||||
os.path.isdir(os.path.join(custom_venv_path, x)) and
|
if x != 'awx' and
|
||||||
os.path.exists(os.path.join(custom_venv_path, x, 'bin', 'activate'))
|
os.path.isdir(os.path.join(custom_venv_path, x)) and
|
||||||
])
|
os.path.exists(os.path.join(custom_venv_path, x, 'bin', 'activate'))
|
||||||
|
])
|
||||||
|
except Exception:
|
||||||
|
logger.exception("Encountered an error while discovering custom virtual environments.")
|
||||||
return custom_venv_choices
|
return custom_venv_choices
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user