Exemplo n.º 1
0
    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)

        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver)

        # setup rpc for security and DHCP agents
        self._setup_rpc()

        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
Exemplo n.º 2
0
    def __init__(self):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_LI('NeutronRestProxy: Starting plugin. Version=%s'),
                 version.version_string_with_vcs())
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # Include the Big Switch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {
            'get_ports': True,
            'get_floating_ips': True,
            'get_routers': True
        }

        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver)

        # setup rpc for security and DHCP agents
        self._setup_rpc()

        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        self.start_periodic_dhcp_agent_status_check()
        LOG.debug("NeutronRestProxyV2: initialization done")
Exemplo n.º 3
0
 def setup_config_files(self):
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     test_lib.test_config['config_files'] = [
         os.path.join(etc_path, 'restproxy.ini.test')
     ]
     self.addCleanup(cfg.CONF.reset)
     config.register_config()
Exemplo n.º 4
0
    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {'get_ports': True,
                                               'get_floating_ips': True,
                                               'get_routers': True}

        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )

        # setup rpc for security and DHCP agents
        self._setup_rpc()

        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
Exemplo n.º 5
0
    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)

        # init dhcp support
        self.topic = topics.PLUGIN
        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver)
        self._dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
        self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
            self._dhcp_agent_notifier)
        self.conn = rpc.create_connection(new=True)
        self.callbacks = RpcProxy()
        self.dispatcher = self.callbacks.create_rpc_dispatcher()
        self.conn.create_consumer(self.topic, self.dispatcher, fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
Exemplo n.º 6
0
    def __init__(self, server_timeout=None):
        super(NeutronRestProxyV2, self).__init__()
        LOG.info(_('NeutronRestProxy: Starting plugin. Version=%s'),
                 version_string_with_vcs())
        pl_config.register_config()

        # Include the BigSwitch Extensions path in the api_extensions
        neutron_extensions.append_api_extensions_path(extensions.__path__)

        self.add_meta_server_route = cfg.CONF.RESTPROXY.add_meta_server_route

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)

        # init dhcp support
        self.topic = topics.PLUGIN
        self.network_scheduler = importutils.import_object(
            cfg.CONF.network_scheduler_driver
        )
        self._dhcp_agent_notifier = dhcp_rpc_agent_api.DhcpAgentNotifyAPI()
        self.agent_notifiers[const.AGENT_TYPE_DHCP] = (
            self._dhcp_agent_notifier
        )
        self.conn = rpc.create_connection(new=True)
        self.callbacks = RpcProxy()
        self.dispatcher = self.callbacks.create_rpc_dispatcher()
        self.conn.create_consumer(self.topic, self.dispatcher,
                                  fanout=False)
        # Consume from all consumers in a thread
        self.conn.consume_in_thread()
        if cfg.CONF.RESTPROXY.sync_data:
            self._send_all_data()

        LOG.debug(_("NeutronRestProxyV2: initialization done"))
Exemplo n.º 7
0
 def setup_config_files(self):
     etc_path = os.path.join(os.path.dirname(__file__), "etc")
     test_lib.test_config["config_files"] = [os.path.join(etc_path, "restproxy.ini.test")]
     self.addCleanup(cfg.CONF.reset)
     config.register_config()
     # Only try SSL on SSL tests
     cfg.CONF.set_override("server_ssl", False, "RESTPROXY")
     cfg.CONF.set_override("ssl_cert_directory", os.path.join(etc_path, "ssl"), "RESTPROXY")
     # The mock interferes with HTTP(S) connection caching
     cfg.CONF.set_override("cache_connections", False, "RESTPROXY")
Exemplo n.º 8
0
def main():
    config.init(sys.argv[1:])
    config.setup_logging()
    pl_config.register_config()

    integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge
    polling_interval = cfg.CONF.RESTPROXYAGENT.polling_interval
    bsnagent = RestProxyAgent(integ_br, polling_interval,
                              cfg.CONF.RESTPROXYAGENT.virtual_switch_type)
    bsnagent.daemon_loop()
    sys.exit(0)
Exemplo n.º 9
0
def main():
    cfg.CONF(project='neutron')
    config.setup_logging(cfg.CONF)
    pl_config.register_config()

    integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge
    polling_interval = cfg.CONF.RESTPROXYAGENT.polling_interval
    root_helper = cfg.CONF.AGENT.root_helper
    bsnagent = RestProxyAgent(integ_br, polling_interval, root_helper,
                              cfg.CONF.RESTPROXYAGENT.virtual_switch_type)
    bsnagent.daemon_loop()
    sys.exit(0)
Exemplo n.º 10
0
    def initialize(self, server_timeout=None):
        LOG.debug(_('Initializing driver'))

        # register plugin config opts
        pl_config.register_config()
        # backend doesn't support bulk operations yet
        self.native_bulk_support = False

        # init network ctrl connections
        self.servers = ServerPool(server_timeout)
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        LOG.debug(_("Initialization done"))
Exemplo n.º 11
0
 def setup_config_files(self):
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     test_lib.test_config['config_files'] = [os.path.join(etc_path,
                                             'restproxy.ini.test')]
     self.addCleanup(cfg.CONF.reset)
     config.register_config()
     # Only try SSL on SSL tests
     cfg.CONF.set_override('server_ssl', False, 'RESTPROXY')
     cfg.CONF.set_override('ssl_cert_directory',
                           os.path.join(etc_path, 'ssl'), 'RESTPROXY')
     # The mock interferes with HTTP(S) connection caching
     cfg.CONF.set_override('cache_connections', False, 'RESTPROXY')
Exemplo n.º 12
0
    def initialize(self, server_timeout=None):
        LOG.debug(_('Initializing driver'))

        # register plugin config opts
        pl_config.register_config()
        # backend doesn't support bulk operations yet
        self.native_bulk_support = False

        # init network ctrl connections
        self.servers = ServerPool(server_timeout)
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        LOG.debug(_("Initialization done"))
Exemplo n.º 13
0
def main():
    config.init(sys.argv[1:])
    config.setup_logging(cfg.CONF)
    pl_config.register_config()

    integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge
    polling_interval = cfg.CONF.RESTPROXYAGENT.polling_interval
    root_helper = cfg.CONF.AGENT.root_helper
    bsnagent = RestProxyAgent(integ_br, polling_interval, root_helper,
                              cfg.CONF.RESTPROXYAGENT.virtual_switch_type)
    bsnagent.daemon_loop()
    sys.exit(0)
Exemplo n.º 14
0
def main():
    eventlet.monkey_patch()
    cfg.CONF(project='neutron')
    config.setup_logging(cfg.CONF)
    pl_config.register_config()

    integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge
    polling_interval = cfg.CONF.RESTPROXYAGENT.polling_interval
    root_helper = cfg.CONF.AGENT.root_helper
    bsnagent = RestProxyAgent(integ_br, polling_interval, root_helper,
                              cfg.CONF.RESTPROXYAGENT.virtual_switch_type)
    bsnagent.daemon_loop()
    sys.exit(0)
Exemplo n.º 15
0
 def setup_config_files(self):
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     test_lib.test_config['config_files'] = [
         os.path.join(etc_path, 'restproxy.ini.test')
     ]
     self.addCleanup(cfg.CONF.reset)
     config.register_config()
     # Only try SSL on SSL tests
     cfg.CONF.set_override('server_ssl', False, 'RESTPROXY')
     cfg.CONF.set_override('ssl_cert_directory',
                           os.path.join(etc_path, 'ssl'), 'RESTPROXY')
     # The mock interferes with HTTP(S) connection caching
     cfg.CONF.set_override('cache_connections', False, 'RESTPROXY')
Exemplo n.º 16
0
    def initialize(self):
        LOG.debug(_("Initializing driver"))

        # register plugin config opts
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)
        # backend doesn't support bulk operations yet
        self.native_bulk_support = False

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {"get_ports": True, "get_floating_ips": False, "get_routers": False}
        self.segmentation_types = ", ".join(cfg.CONF.ml2.type_drivers)
        LOG.debug(_("Initialization done"))
Exemplo n.º 17
0
    def initialize(self, server_timeout=None):
        LOG.debug(_('Initializing driver'))

        # register plugin config opts
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)
        # backend doesn't support bulk operations yet
        self.native_bulk_support = False

        # init network ctrl connections
        self.servers = servermanager.ServerPool(server_timeout)
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {'get_ports': True,
                                               'get_floating_ips': False,
                                               'get_routers': False}
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        LOG.debug(_("Initialization done"))
Exemplo n.º 18
0
    def initialize(self):
        LOG.debug('Initializing driver')

        # register plugin config opts
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {'get_ports': True,
                                               'get_floating_ips': False,
                                               'get_routers': False}
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        # Track hosts running IVS to avoid excessive calls to the backend
        self.ivs_host_cache = {}

        LOG.debug("Initialization done")
Exemplo n.º 19
0
    def initialize(self):
        LOG.debug('Initializing driver')

        # register plugin config opts
        pl_config.register_config()
        self.evpool = eventlet.GreenPool(cfg.CONF.RESTPROXY.thread_pool_size)

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data
        self.servers.get_topo_function_args = {'get_ports': True,
                                               'get_floating_ips': False,
                                               'get_routers': False}
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        # Track hosts running IVS to avoid excessive calls to the backend
        self.ivs_host_cache = {}

        LOG.debug("Initialization done")
Exemplo n.º 20
0
def init_config():
    """Initialize configuration for this script"""
    logging.setup("sync_network")
    cfgfile = get_config_files()
    cfg.CONF(
        args=[j for i in zip(["--config-file"]*len(cfgfile), cfgfile)
              for j in i],
        project="neutron",
    )
    cfg.CONF.set_override('control_exchange', '')
    cfg.CONF.set_override('rpc_backend', 'neutron.openstack.common.rpc.impl_fake')
    cfg.CONF.set_override('verbose', True)
    cfg.CONF.set_override('debug', True)
    config.register_config()
    cfg.CONF.set_override('consistency_interval', 0, 'RESTPROXY')
    cfg.CONF.set_override('sync_data', False, 'RESTPROXY')
    # override to suppress annoying mysql mode warning
    session.LOG.warning = lambda *args, **kwargs: True
    # replace watchdog so it doesn't try to start
    servermanager.ServerPool._consistency_watchdog = lambda x, y: True
Exemplo n.º 21
0
 def setup_config_files(self):
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     test_lib.test_config['config_files'] = [os.path.join(etc_path,
                                             'restproxy.ini.test')]
     self.addCleanup(cfg.CONF.reset)
     config.register_config()