def _verify_options(options):

    # sanity check all vals used for bitwise operations later
    bitwise_args = [('level', options['level']),
                    ('facility', options['facility'])
                    ]
    bitwise_args.extend([('option', x) for x in options['options']])

    for opt_name, opt in bitwise_args:
        if not hasattr(syslog, opt):
            log.error('syslog has no attribute {0}'.format(opt))
            return False
        if not isinstance(getattr(syslog, opt), int):
            log.error('{0} is not a valid syslog {1}'.format(opt, opt_name))
            return False

    # Sanity check tag
    if 'tag' in options:
        if not isinstance(options['tag'], six.string_types):
            log.error('tag must be a string')
            return False
        if len(options['tag']) > 32:
            log.error('tag size is limited to 32 characters')
            return False

    return True
Verify options and log warnings
dataset/ETHPy150Open saltstack/salt/salt/returners/syslog_return.py/_verify_options