neutron_mods = repos.NeutronModules()
for x in neutron_mods.installed_list():
- paths += neutron_mods.module(x).__path__
+ try:
+ paths += neutron_mods.module(x).extensions.__path__
+ except AttributeError:
+ # Occurs normally if module has no extensions sub-module
+ pass
if cfg.CONF.api_extensions_path:
paths.append(cfg.CONF.api_extensions_path)
def __init__(self, message=None):
self.message = message
super(IpTablesApplyException, self).__init__()
+
+
+# Shared *aas exceptions, pending them being refactored out of Neutron
+# proper.
+
+class FirewallInternalDriverError(NeutronException):
+ """Fwaas exception for all driver errors.
+
+ On any failure or exception in the driver, driver should log it and
+ raise this exception to the agent
+ """
+ message = _("%(driver)s: Internal driver error.")
+
+
+class RouterInUseByVPNService(InUse):
+ message = _("Router %(router_id)s is used by VPNService %(vpnservice_id)s")
from neutron.agent.common import config
from neutron.agent.linux import ip_lib
+from neutron.common import exceptions as nexception
from neutron.common import topics
from neutron import context
-from neutron.extensions import firewall as fw_ext
from neutron.i18n import _LE
from neutron.openstack.common import log as logging
from neutron.plugins.common import constants
status = constants.ACTIVE
else:
status = constants.DOWN
- except fw_ext.FirewallInternalDriverError:
+ except nexception.FirewallInternalDriverError:
LOG.error(_LE("Firewall Driver Error for %(func_name)s "
"for fw: %(fwid)s"),
{'func_name': func_name, 'fwid': fw['id']})
self.fwplugin_rpc.firewall_deleted(
ctx,
fw['id'])
- except fw_ext.FirewallInternalDriverError:
+ except nexception.FirewallInternalDriverError:
LOG.error(_LE("Firewall Driver Error on fw state %(fwmsg)s "
"for fw: %(fwid)s"),
{'fwmsg': fw['status'], 'fwid': fw['id']})
status = constants.ACTIVE
else:
status = constants.DOWN
- except fw_ext.FirewallInternalDriverError:
+ except nexception.FirewallInternalDriverError:
LOG.error(_LE("Firewall Driver Error on fw state %(fwmsg)s "
"for fw: %(fwid)s"),
{'fwmsg': fw['status'], 'fwid': fw['id']})
import mock
from neutron.common import constants as l3_const
+from neutron.common import exceptions as nexception
from neutron import context
from neutron.db import l3_dvr_db
from neutron.extensions import l3
-from neutron.extensions import vpnaas
from neutron import manager
from neutron.openstack.common import uuidutils
from neutron.tests.unit import testlib_api
return router_db, fw_mock, vpn_mock
if not no_vpn and test_side_effect_vpn:
self.assertRaises(
- vpnaas.RouterInUseByVPNService,
+ nexception.RouterInUseByVPNService,
self.mixin._validate_router_migration,
self.ctx,
router_db,
router_db, mock_firewall, mock_vpnaas = (
self._router_migration_with_services_setup(
test_side_effect_vpn=(
- vpnaas.RouterInUseByVPNService(
+ nexception.RouterInUseByVPNService(
router_id='fake_id',
vpnservice_id='fake_vpnaas_id')
),