@pytest.fixture
def add_switch():

    def _inner(hostname, rack, rank, appliance, make, model):
        cmd = f'stack add host {hostname} rack={rack} rank={rank} appliance={appliance}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to add a dummy host')
        cmd = f'stack set host attr {hostname} attr=component.make value={make}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to set make')
        cmd = f'stack set host attr {hostname} attr=component.model value={model}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to set model')
    _inner('switch-0-0', '0', '0', 'switch', 'fake', 'unrl')
    return _inner
@pytest.fixture
def add_switch():

    def _inner(hostname, rack, rank, appliance, make, model):
        cmd = f'stack add host {hostname} rack={rack} rank={rank} appliance={appliance}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to add a dummy host')
        cmd = f'stack set host attr {hostname} attr=component.make value={make}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to set make')
        cmd = f'stack set host attr {hostname} attr=component.model value={model}'
        result = subprocess.run(cmd.split())
        if (result.returncode != 0):
            pytest.fail('unable to set model')
    _inner('switch-0-0', '0', '0', 'switch', 'fake', 'unrl')
    return _inner