mirror of
https://github.com/ansible/awx.git
synced 2026-02-27 15:58:45 -03:30
added try/except to virtual env
This commit is contained in:
committed by
Ryan Petrello
parent
3ded30411f
commit
492d01ff3b
@@ -1010,14 +1010,18 @@ 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.")
|
||||||
|
pass
|
||||||
return custom_venv_choices
|
return custom_venv_choices
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user