<s> from neutron_lib . api import converters <EOL> from neutron_lib . api import validators <EOL> from neutron_lib import constants <EOL> from neutron_lib import exceptions <EOL> from oslo_config import cfg <EOL> from oslo_log import log as logging <EOL> from neutron . _i18n import _ , _LI <EOL> from neutron . api import extensions <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class VlanTransparencyDriverError ( exceptions . NeutronException ) : <EOL> """<STR_LIT>""" <EOL> message = _ ( "<STR_LIT>" ) <EOL> VLANTRANSPARENT = '<STR_LIT>' <EOL> EXTENDED_ATTRIBUTES_2_0 = { <EOL> '<STR_LIT>' : { <EOL> VLANTRANSPARENT : { '<STR_LIT>' : True , '<STR_LIT>' : False , <EOL> '<STR_LIT>' : converters . convert_to_boolean , <EOL> '<STR_LIT:default>' : constants . ATTR_NOT_SPECIFIED , <EOL> '<STR_LIT>' : True } , <EOL> } , <EOL> } <EOL> def disable_extension_by_config ( aliases ) : <EOL> if not cfg . CONF . vlan_transparent : <EOL> if '<STR_LIT>' in aliases : <EOL> aliases . remove ( '<STR_LIT>' ) <EOL> LOG . info ( _LI ( '<STR_LIT>' ) ) <EOL> def get_vlan_transparent ( network ) : <EOL> return ( network [ '<STR_LIT>' ] <EOL> if ( '<STR_LIT>' in network and <EOL> validators . is_attr_set ( network [ '<STR_LIT>' ] ) ) <EOL> else False ) <EOL> class Vlantransparent ( extensions . ExtensionDescriptor ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def get_name ( cls ) : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def get_alias ( cls ) : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def get_description ( cls ) : <EOL> return "<STR_LIT>" <EOL> @ classmethod <EOL> def get_updated ( cls ) : <EOL> return "<STR_LIT>" <EOL> def get_extended_resources ( self , version ) : <EOL> if version == "<STR_LIT>" : <EOL> return EXTENDED_ATTRIBUTES_2_0 <EOL> else : <EOL> return { } </s>
