def ensure_device_is_ready(device_name, namespace=None):
    dev = IPDevice(device_name, namespace=namespace)
    dev.set_log_fail_as_error(False)
    try:
        # Ensure the device is up, even if it is already up. If the device
        # doesn't exist, a RuntimeError will be raised.
        dev.link.set_up()
    except __HOLE__:
        return False
    return True
dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/ip_lib.py/ensure_device_is_ready