示例#1
0
def step_impl(context, device_name):
    device = None
    for dev in Device.discover():
        if dev.name == device_name:
            device = dev
    assert device is not None   # TODO: create the device if necessary
    context.device = device
示例#2
0
def step_impl(context, device_name):
    for dev in Device.discover():
        if dev.name == device_name and not dev.is_down():
            dev.disable()
            context.device = dev
示例#3
0
def step_impl(context, address, device_name):
    for dev in Device.discover():
        if dev.name == device_name and not dev.contains_address(address):
            dev.add_address(address)
            context.device = dev
示例#4
0
def step_impl(context):
    context.devices = Device.discover()