# Path: apic_ml2/neutron/extensions/cisco_apic.py
# ALIAS = 'cisco-apic'
# ALLOW_ROUTE_LEAK = 'apic:allow_route_leak'
# NET_ATTRIBUTES = {
#     ALLOW_ROUTE_LEAK: {
#         'allow_post': True, 'allow_put': False,
#         'is_visible': True, 'default': False,
#         'convert_to': conv.convert_to_boolean,
#     },
# }
# EXTENDED_ATTRIBUTES_2_0 = {
#     attributes.NETWORKS: dict(NET_ATTRIBUTES.items()),
# }
# class Cisco_apic(extensions.ExtensionDescriptor):
#     def get_name(cls):
#     def get_alias(cls):
#     def get_description(cls):
#     def get_updated(cls):
#     def get_extended_resources(self, version):
# 
# Path: apic_ml2/neutron/plugins/ml2/drivers/cisco/apic/extension_db.py
# class NetworkExtensionDb(model_base.BASEV2):
# class RouterExtensionDb(model_base.BASEV2):
# class ExtensionDbMixin(object):
#     def _set_if_not_none(self, res_dict, res_attr, db_attr):
#     def get_network_extn_db(self, session, network_id):
#     def set_network_extn_db(self, session, network_id, res_dict):
#     def get_router_extn_db(self, session, router_id):
#     def set_router_extn_db(self, session, router_id, res_dict):


from neutron._i18n import _LI
from neutron.api import extensions
from neutron.plugins.ml2 import driver_api
from oslo_log import log
from apic_ml2.neutron import extensions as extensions_pkg
from apic_ml2.neutron.extensions import cisco_apic
from apic_ml2.neutron.plugins.ml2.drivers.cisco.apic import (
    extension_db as extn_db)
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



LOG = log.getLogger(__name__)


class ApicExtensionDriver(driver_api.ExtensionDriver,
                          extn_db.ExtensionDbMixin):

    def __init__(self):
        LOG.info(_LI("APIC ML2 Extension Driver __init__"))

    def initialize(self):
        LOG.info(_LI("APIC ML2 Extension Driver initializing"))
        extensions.append_api_extensions_path(extensions_pkg.__path__)

    @property
    def extension_alias(self):
        return "cisco-apic"

    def extend_network_dict(self, session, base_model, result):
        res_dict = self.get_network_extn_db(session, result['id'])
        result[cisco_apic.ALLOW_ROUTE_LEAK] = res_dict.get(
            cisco_apic.ALLOW_ROUTE_LEAK, False)

    def process_create_network(self, plugin_context, data, result):

# Path: apic_ml2/neutron/extensions/cisco_apic.py
# ALIAS = 'cisco-apic'
# ALLOW_ROUTE_LEAK = 'apic:allow_route_leak'
# NET_ATTRIBUTES = {
#     ALLOW_ROUTE_LEAK: {
#         'allow_post': True, 'allow_put': False,
#         'is_visible': True, 'default': False,
#         'convert_to': conv.convert_to_boolean,
#     },
# }
# EXTENDED_ATTRIBUTES_2_0 = {
#     attributes.NETWORKS: dict(NET_ATTRIBUTES.items()),
# }
# class Cisco_apic(extensions.ExtensionDescriptor):
#     def get_name(cls):
#     def get_alias(cls):
#     def get_description(cls):
#     def get_updated(cls):
#     def get_extended_resources(self, version):
# 
# Path: apic_ml2/neutron/plugins/ml2/drivers/cisco/apic/extension_db.py
# class NetworkExtensionDb(model_base.BASEV2):
# class RouterExtensionDb(model_base.BASEV2):
# class ExtensionDbMixin(object):
#     def _set_if_not_none(self, res_dict, res_attr, db_attr):
#     def get_network_extn_db(self, session, network_id):
#     def set_network_extn_db(self, session, network_id, res_dict):
#     def get_router_extn_db(self, session, router_id):
#     def set_router_extn_db(self, session, router_id, res_dict):


# Path: apic_ml2/neutron/plugins/ml2/drivers/cisco/apic/extension_driver.py
from neutron._i18n import _LI
from neutron.api import extensions
from neutron.plugins.ml2 import driver_api
from oslo_log import log
from apic_ml2.neutron import extensions as extensions_pkg
from apic_ml2.neutron.extensions import cisco_apic
from apic_ml2.neutron.plugins.ml2.drivers.cisco.apic import (
    extension_db as extn_db)

#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.



LOG = log.getLogger(__name__)


class ApicExtensionDriver(driver_api.ExtensionDriver,
                          extn_db.ExtensionDbMixin):

    def __init__(self):
        LOG.info(_LI("APIC ML2 Extension Driver __init__"))

    def initialize(self):
        LOG.info(_LI("APIC ML2 Extension Driver initializing"))
        extensions.append_api_extensions_path(extensions_pkg.__path__)

    @property
    def extension_alias(self):
        return "cisco-apic"

    def extend_network_dict(self, session, base_model, result):
        res_dict = self.get_network_extn_db(session, result['id'])
        result[cisco_apic.ALLOW_ROUTE_LEAK] = res_dict.get(
            cisco_apic.ALLOW_ROUTE_LEAK, False)

    def process_create_network(self, plugin_context, data, result):

        res_dict = {cisco_apic.ALLOW_ROUTE_LEAK: