def _parse_settings_vlan(opts, iface):

    '''
    Filters given options and outputs valid settings for a vlan
    '''
    vlan = {}
    if 'reorder_hdr' in opts:
        if opts['reorder_hdr'] in _CONFIG_TRUE + _CONFIG_FALSE:
            vlan.update({'reorder_hdr': opts['reorder_hdr']})
        else:
            valid = _CONFIG_TRUE + _CONFIG_FALSE
            _raise_error_iface(iface, 'reorder_hdr', valid)

    if 'vlan_id' in opts:
        if opts['vlan_id'] > 0:
            vlan.update({'vlan_id': opts['vlan_id']})
        else:
            _raise_error_iface(iface, 'vlan_id', 'Positive integer')

    if 'phys_dev' in opts:
        if len(opts['phys_dev']) > 0:
            vlan.update({'phys_dev': opts['phys_dev']})
        else:
            _raise_error_iface(iface, 'phys_dev', 'Non-empty string')

    return vlan
dataset/ETHPy150Open saltstack/salt/salt/modules/rh_ip.py/_parse_settings_vlan/original