def METHOD_NAME(nics, name, subcommand):
    """Takes ethtool subcommands and raises an exception if there is a device
    that does not belong to the network"""
    if not nics:
        raise RuntimeError('Network %s has no nics.' % name)
    if subcommand.device not in nics:
        raise RuntimeError('Trying to apply ethtool opts for dev: %s, not in '
                           '%s nics: %s' % (subcommand.device, name, nics))