Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Added default template parameter in create_vm fixture.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulage committed Feb 7, 2020
1 parent 912d31f commit 0721d94
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions cfme/fixtures/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,16 @@ def _get_vm_name(request):

@pytest.fixture(scope="module")
def create_vm_modscope(setup_provider_modscope, request, provider):
if request.param:
template_type = request.param
else:
pytest.error('Any appropriate Template was not passed to the fixture.')
# If no template parameter is passed, then use 'small_template'.
template_type = getattr(request, 'param', 'small_template')
vm_name = _get_vm_name(request)
return _create_vm(request, template_type, provider, vm_name)


@pytest.fixture(scope="function")
def create_vm(setup_provider, request, provider):
if request.param:
template_type = request.param
else:
pytest.error('Any appropriate Template was not passed to the fixture.')
# If no template parameter is passed, then use 'small_template'.
template_type = getattr(request, 'param', 'small_template')
vm_name = _get_vm_name(request)
return _create_vm(request, template_type, provider, vm_name)

Expand Down

0 comments on commit 0721d94

Please sign in to comment.