def _is_switchdev(netdev):
    """Returns True if a netdev has a readable phys_switch_id"""
    try:
        sw_id_file = '/sys/class/net/%s/phys_switch_id' % netdev
        with open(sw_id_file, 'r') as fd:
            phys_switch_id = fd.readline().rstrip()
        if phys_switch_id != '' and phys_switch_id is not None:
            return True
    except (OSError, IOError):
        return False
    return False
