Exemple #1
0
 def __init__(self):
     super(TunnlePlugin, self).__init__()
     # Load the service driver from neutron.conf.
     drivers, default_provider = service_base.load_drivers(
         constants.TUNNEL, self)
     LOG.info(_("Tunnel plugin using service driver: %s"), default_provider)
     self.gre_driver = drivers[default_provider]
    def __init__(self):
        super(FirewallPluginV2, self).__init__()
        """Do the initialization for the firewall service plugin here."""
        # Initialize the Firewall v2 service plugin
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            fwaas_constants.FIREWALL_V2,
            provider_conf.ProviderConfiguration('neutron_fwaas'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(
            fwaas_constants.FIREWALL_V2, self)
        LOG.info("Firewall v2 Service Plugin using Service Driver: %s",
                 default_provider)

        if len(drivers) > 1:
            LOG.warning("Multiple drivers configured for Firewall v2, "
                        "although running multiple drivers in parallel is "
                        "not yet supported")

        self.driver = drivers[default_provider]

        # start rpc listener if driver required
        if isinstance(self.driver, driver_api.FirewallDriverRPCMixin):
            rpc_worker = service.RpcWorker([self], worker_process_count=0)
            self.add_worker(rpc_worker)
Exemple #3
0
 def __init__(self):
     super(VPNDriverPlugin, self).__init__()
     # Load the service driver from neutron.conf.
     drivers, default_provider = service_base.load_drivers(
         constants.VPN, self)
     LOG.info(_LI("VPN plugin using service driver: %s"), default_provider)
     self.ipsec_driver = drivers[default_provider]
Exemple #4
0
    def __init__(self):
        super(BGPVPNPlugin, self).__init__()

        # Need to look into /etc/neutron/networking_bgpvpn.conf for
        # service_provider definitions:
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            bgpvpn_def.LABEL, pconf.ProviderConfiguration('networking_bgpvpn'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(
            bgpvpn_def.LABEL, self)
        LOG.info("BGP VPN Service Plugin using Service Driver: %s",
                 default_provider)
        self.driver = drivers[default_provider]

        if len(drivers) > 1:
            LOG.warning("Multiple drivers configured for BGPVPN, although"
                        "running multiple drivers in parallel is not yet"
                        "supported")
        registry.subscribe(self._notify_adding_interface_to_router,
                           resources.ROUTER_INTERFACE, events.BEFORE_CREATE)
        registry.subscribe(self._notify_host_updated, n_resources.HOST,
                           events.AFTER_UPDATE)
        registry.subscribe(self._notify_agent_updated, resources.AGENT,
                           events.AFTER_UPDATE)
        registry.subscribe(self._notify_removing_vpn_from_speaker,
                           dr_resources.BGP_SPEAKER_VPN_ASSOC,
                           events.AFTER_DELETE)
    def __init__(self):
        super(FirewallPluginV2, self).__init__()
        """Do the initialization for the firewall service plugin here."""
        # Initialize the Firewall v2 service plugin
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            fwaas_constants.FIREWALL_V2,
            provider_conf.ProviderConfiguration('neutron_fwaas'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(
            fwaas_constants.FIREWALL_V2, self)
        LOG.info("Firewall v2 Service Plugin using Service Driver: %s",
                 default_provider)

        if len(drivers) > 1:
            LOG.warning("Multiple drivers configured for Firewall v2, "
                        "although running multiple drivers in parallel is "
                        "not yet supported")

        self.driver_name = default_provider
        self.driver = drivers[default_provider]

        # start rpc listener if driver required
        if isinstance(self.driver, driver_api.FirewallDriverRPCMixin):
            rpc_worker = service.RpcWorker([self], worker_process_count=0)
            self.add_worker(rpc_worker)

        log_plugin = directory.get_plugin(plugin_const.LOG_API)
        logging_driver.register()
        # If log_plugin was loaded before firewall plugin
        if log_plugin:
            # Register logging driver with LoggingServiceDriverManager again
            log_plugin.driver_manager.register_driver(logging_driver.DRIVER)
Exemple #6
0
 def __init__(self):
     super(TunnlePlugin, self).__init__()
     # Load the service driver from neutron.conf.
     drivers, default_provider = service_base.load_drivers(
         constants.TUNNEL, self)
     LOG.info(_("Tunnel plugin using service driver: %s"), default_provider)
     self.gre_driver = drivers[default_provider]
Exemple #7
0
 def __init__(self):
     super(VPNDriverPlugin, self).__init__()
     self.service_type_manager = st_db.ServiceTypeManager.get_instance()
     add_provider_configuration(self.service_type_manager, constants.VPN)
     # Load the service driver from neutron.conf.
     drivers, default_provider = service_base.load_drivers(constants.VPN, self)
     LOG.info(_LI("VPN plugin using service driver: %s"), default_provider)
     self.ipsec_driver = drivers[default_provider]
     vpn_db.subscribe()
Exemple #8
0
    def _load_drivers(self):
        """Loads plugin-drivers specified in configuration."""
        self.drivers, self.default_provider = service_base.load_drivers(constants.LOADBALANCER, self)

        # we're at the point when extensions are not loaded yet
        # so prevent policy from being loaded
        ctx = context.get_admin_context(load_admin_roles=False)
        # stop service in case provider was removed, but resources were not
        self._check_orphan_pool_associations(ctx, self.drivers.keys())
Exemple #9
0
    def _load_drivers(self):
        """Loads plugin-drivers specified in configuration."""
        self.drivers, self.default_provider = service_base.load_drivers(
            constants.LOADBALANCER, self)

        # we're at the point when extensions are not loaded yet
        # so prevent policy from being loaded
        ctx = context.get_admin_context(load_admin_roles=False)
        # stop service in case provider was removed, but resources were not
        self._check_orphan_pool_associations(ctx, self.drivers.keys())
Exemple #10
0
 def __init__(self):
     super(VPNDriverPlugin, self).__init__()
     self.service_type_manager = st_db.ServiceTypeManager.get_instance()
     add_provider_configuration(self.service_type_manager, constants.VPN)
     # Load the service driver from neutron.conf.
     drivers, default_provider = service_base.load_drivers(
         constants.VPN, self)
     LOG.info("VPN plugin using service driver: %s", default_provider)
     self.ipsec_driver = drivers[default_provider]
     vpn_db.subscribe()
Exemple #11
0
 def __init__(self):
     LOG.debug("ISOFLAT PLUGIN INITIALIZED")
     self.service_type_manager = st_db.ServiceTypeManager.get_instance()
     self.service_type_manager.add_provider_configuration(constants.ISOFLAT,
                                                          pconf.ProviderConfiguration('neutron_isoflat'))
     drivers, default_provider = service_base.load_drivers(constants.ISOFLAT, self)
     if default_provider in drivers:
         self.driver = drivers[default_provider]
     else:
         raise n_exc.Invalid("Error retrieving driver for provider %s" % default_provider)
Exemple #12
0
    def _load_drivers(self):
        """Loads plugin-drivers specified in configuration."""
        self.drivers, self.default_provider = service_base.load_drivers(
            constants.LOADBALANCER, self)

        # NOTE(blogan): this method MUST be called after
        # service_base.load_drivers to correctly verify
        verify_lbaas_mutual_exclusion()

        ctx = ncontext.get_admin_context()
        # stop service in case provider was removed, but resources were not
        self._check_orphan_pool_associations(ctx, self.drivers.keys())
Exemple #13
0
 def __getitem__(self, key):
     try:
         return self.drivers[key]
     except KeyError:
         try:
             service_type_manager = servicetype_db.ServiceTypeManager.get_instance()
             add_provider_configuration(service_type_manager, key)
             self.drivers[key] = service_base.load_drivers(key, self.plugin)
         except BaseException:
             # Catch BaseException because load_drivers throws SystemExit
             # Pass becasue we'd just raise KeyError and the next line does that
             pass
         return self.drivers[key]
Exemple #14
0
    def _load_drivers(self):
        """Loads plugin-drivers specified in configuration."""
        self.drivers, self.default_provider = service_base.load_drivers(
            constants.LOADBALANCER, self)

        # NOTE(blogan): this method MUST be called after
        # service_base.load_drivers to correctly verify
        verify_lbaas_mutual_exclusion()

        # we're at the point when extensions are not loaded yet
        # so prevent policy from being loaded
        ctx = ncontext.get_admin_context(load_admin_roles=False)
        # stop service in case provider was removed, but resources were not
        self._check_orphan_pool_associations(ctx, self.drivers.keys())
Exemple #15
0
    def _load_drivers(self):
        """Loads plugin-drivers specified in configuration."""
        self.drivers, self.default_provider = service_base.load_drivers(
            constants.LOADBALANCER, self)

        # NOTE(blogan): this method MUST be called after
        # service_base.load_drivers to correctly verify
        verify_lbaas_mutual_exclusion()

        # we're at the point when extensions are not loaded yet
        # so prevent policy from being loaded
        ctx = ncontext.get_admin_context(load_admin_roles=False)
        # stop service in case provider was removed, but resources were not
        self._check_orphan_pool_associations(ctx, self.drivers.keys())
Exemple #16
0
 def __init__(self):
     super(VPNDriverPlugin, self).__init__()
     self.service_type_manager = st_db.ServiceTypeManager.get_instance()
     add_provider_configuration(self.service_type_manager, constants.VPN)
     # Load the service driver from neutron.conf.
     self.drivers, self.default_provider = service_base.load_drivers(
         constants.VPN, self)
     self._check_orphan_vpnservice_associations()
     # Associate driver names to driver objects
     for driver_name, driver in self.drivers.items():
         driver.name = driver_name
     LOG.info(("VPN plugin using service drivers: %(service_drivers)s, "
               "default: %(default_driver)s"),
              {'service_drivers': self.drivers.keys(),
               'default_driver': self.default_provider})
     vpn_db.subscribe()
Exemple #17
0
 def __init__(self):
     super(VPNDriverPlugin, self).__init__()
     self.service_type_manager = st_db.ServiceTypeManager.get_instance()
     add_provider_configuration(self.service_type_manager, constants.VPN)
     # Load the service driver from neutron.conf.
     self.drivers, self.default_provider = service_base.load_drivers(
         constants.VPN, self)
     self._check_orphan_vpnservice_associations()
     # Associate driver names to driver objects
     for driver_name, driver in self.drivers.items():
         driver.name = driver_name
     LOG.info(
         ("VPN plugin using service drivers: %(service_drivers)s, "
          "default: %(default_driver)s"), {
              'service_drivers': self.drivers.keys(),
              'default_driver': self.default_provider
          })
     vpn_db.subscribe()
    def __init__(self):
        super(BGPVPNPlugin, self).__init__()

        # Need to look into /etc/neutron/networking_bgpvpn.conf for
        # service_provider definitions:
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            constants.BGPVPN, pconf.ProviderConfiguration('networking_bgpvpn'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(
            constants.BGPVPN, self)
        LOG.info(_LI("BGP VPN Service Plugin using Service Driver: %s"),
                 default_provider)
        self.driver = drivers[default_provider]

        if len(drivers) > 1:
            LOG.warning(
                _LI("Multiple drivers configured for BGPVPN, although"
                    "running multiple drivers in parallel is not yet"
                    "supported"))
    def __init__(self):
        super(BGPVPNPlugin, self).__init__()

        # Need to look into /etc/neutron/networking_bgpvpn.conf for
        # service_provider definitions:
        service_type_manager = st_db.ServiceTypeManager.get_instance()
        service_type_manager.add_provider_configuration(
            constants.BGPVPN,
            pconf.ProviderConfiguration('networking_bgpvpn'))

        # Load the default driver
        drivers, default_provider = service_base.load_drivers(constants.BGPVPN,
                                                              self)
        LOG.info(_LI("BGP VPN Service Plugin using Service Driver: %s"),
                 default_provider)
        self.driver = drivers[default_provider]

        if len(drivers) > 1:
            LOG.warning(_LI("Multiple drivers configured for BGPVPN, although"
                            "running multiple drivers in parallel is not yet"
                            "supported"))
Exemple #20
0
 def _load_drivers(self):
     """Loads plugin-drivers specified in configuration."""
     self.drivers, self.default_provider = service_base.load_drivers(
         'TAAS', self)
Exemple #21
0
 def _load_drivers(self):
     self.drivers, self.default_provider = (
         service_base.load_drivers(constants.L3_ROUTER_NAT, self.l3_plugin))
     # store the provider name on each driver to make finding inverse easy
     for provider_name, driver in self.drivers.items():
         setattr(driver, 'name', provider_name)
Exemple #22
0
 def _load_drivers(self):
     self.drivers, self.default_provider = (service_base.load_drivers(
         plugin_constants.L3, self.l3_plugin))
     # store the provider name on each driver to make finding inverse easy
     for provider_name, driver in self.drivers.items():
         setattr(driver, 'name', provider_name)
 def _load_drivers(self):
     """Loads plugin-drivers specified in configuration."""
     self.drivers, self.default_provider = service_base.load_drivers(
         taas_consts.TAAS, self)
Exemple #24
0
 def _load_drivers(self):
     """Loads plugin-drivers specified in configuration."""
     self.drivers, self.default_provider = service_base.load_drivers(
         constants.LOADBALANCER, self)