def check_for_invalid_fields(fields, valid_fields):
    if not fields:
        return

    invalid_fields = set(fields) - set(valid_fields)
    if invalid_fields:
        raise exc.CommandError(
            _('Invalid field(s) requested: %(invalid)s. Valid fields '
              'are: %(valid)s.') % {'invalid': ', '.join(invalid_fields),
                                    'valid': ', '.join(valid_fields)})
Kill any managed threads marked as protected when they were
dataset/ETHPy150Open openstack/python-ironicclient/ironicclient/common/utils.py/check_for_invalid_fields--crossover with--dataset/ETHPy150Open onefinestay/nameko/nameko/containers.py/ServiceContainer._kill_protected_threads