mirror of
https://github.com/ansible/awx.git
synced 2026-06-30 10:58:03 -02:30
Validate virtual environment while running a job/inventory update
Currently we only check the custom virtual environment path when it's created. However, to tackle with the case when the venv might have been changed/deleted afterward, we need to validate it at run-time too. Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
This commit is contained in:
committed by
Ryan Petrello
parent
6d5897f371
commit
5d570a017a
@@ -525,10 +525,10 @@ class TestGenericRun():
|
||||
job.project.custom_virtualenv = '/venv/missing'
|
||||
task = tasks.RunJob()
|
||||
|
||||
with pytest.raises(RuntimeError) as e:
|
||||
with pytest.raises(tasks.InvalidVirtualenvError) as e:
|
||||
task.build_env(job, private_data_dir)
|
||||
|
||||
assert 'a valid Python virtualenv does not exist at /venv/missing' == str(e.value)
|
||||
assert 'Invalid virtual environment selected: /venv/missing' == str(e.value)
|
||||
|
||||
|
||||
class TestAdhocRun(TestJobExecution):
|
||||
|
||||
Reference in New Issue
Block a user