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
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
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
def step_impl(context): context.devices = Device.discover()