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

Commit

Permalink
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions cfme/fixtures/nuage.py
Original file line number Diff line number Diff line change
@@ -5,10 +5,8 @@
from cfme.utils.log import logger


@pytest.fixture
def with_nuage_sandbox(networks_provider):
nuage = networks_provider.mgmt
sandbox = box = {}
def create_basic_sandbox(nuage):
box = {}

# Create empty enterprise aka 'sandbox'.
enterprise = box['enterprise'] = nuage.create_enterprise()
@@ -45,9 +43,18 @@ def with_nuage_sandbox(networks_provider):
box['l2_group'] = box['l2_domain'].create_child(
nuage.vspk.NUPolicyGroup(name=random_name()))[0]

return box


@pytest.fixture
def with_nuage_sandbox(networks_provider):
nuage = networks_provider.mgmt
sandbox = create_basic_sandbox(nuage)

# Let integration test do whatever it needs to do.
yield sandbox

# Destroy the sandbox.
enterprise = sandbox['enterprise']
nuage.delete_enterprise(enterprise)
logger.info('Destroyed sandbox enterprise {} ({})'.format(enterprise.name, enterprise.id))

0 comments on commit d7c0029

Please sign in to comment.