Пример #1
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': True,
            'get_routers': True,
            'get_sgs': True
        }
        # perform one forced topo_sync after 60secs. delayed to let plugin
        # initialization complete
        eventlet.spawn_after(60, self.servers.force_topo_sync,
                             **{'check_ts': True})

        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        # if os-net-config is present, attempt to read physnet bridge_mappings
        # from openvswitch_agent.ini
        self.bridge_mappings = {}
        if os.path.isfile(RH_NET_CONF_PATH):
            self.bridge_mappings = _read_ovs_bridge_mappings()
        # Track hosts running IVS to avoid excessive calls to the backend
        self.ivs_host_cache = {}
        self.setup_rpc_callbacks()

        LOG.debug("Initialization done")
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)
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)
 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)
     self.addCleanup(consistency_db.clear_db)
     config.register_config()
     # Only try SSL on SSL tests
     cfg.CONF.set_override('server_ssl', False, 'RESTPROXY')
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     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')
     cfg.CONF.set_override('service_plugins', ['bigswitch_l3'])
     cfg.CONF.set_override('add_meta_server_route', False, 'RESTPROXY')
     cfg.CONF.set_override('api_extensions_path', False)
 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)
     self.addCleanup(consistency_db.clear_db)
     config.register_config()
     # Only try SSL on SSL tests
     cfg.CONF.set_override('server_ssl', False, 'RESTPROXY')
     etc_path = os.path.join(os.path.dirname(__file__), 'etc')
     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')
     cfg.CONF.set_override('service_plugins', ['bigswitch_l3'])
     cfg.CONF.set_override('add_meta_server_route', False, 'RESTPROXY')
     cfg.CONF.set_override('api_extensions_path', False)
Пример #6
0
    def __init__(self):
        bigswitch_config.register_config()
        networking_bigswitch_l3_pe.lib.config.register_config()

        api_url = cfg.CONF.networking_bigswitch_l3_pe.api_url
        username, password = cfg.CONF.RESTPROXY.server_auth.split(':')
        self.neutron_id = cfg.CONF.RESTPROXY.neutron_id
        exclude_physical_networks = \
            cfg.CONF.networking_bigswitch_l3_pe.exclude_physical_networks
        self.sync = Synchronizer(api_url, username, password, self.neutron_id,
                                 exclude_physical_networks)
        self.notifier = EventNotifier()
        self.watcher = EventWatcher()
        self.keystone_client = KeystoneClient()
        self.db_plugin = db_base_plugin_v2.NeutronDbPluginV2()

        eventlet.spawn(self.watcher.watch)
        eventlet.spawn(self._bcf_sync,
                       cfg.CONF.networking_bigswitch_l3_pe.sync_interval)
Пример #7
0
    def __init__(self):
        bigswitch_config.register_config()
        networking_bigswitch_l3_pe.lib.config.register_config()

        api_url = cfg.CONF.networking_bigswitch_l3_pe.api_url
        username, password = cfg.CONF.RESTPROXY.server_auth.split(':')
        self.neutron_id = cfg.CONF.RESTPROXY.neutron_id
        exclude_physical_networks = \
            cfg.CONF.networking_bigswitch_l3_pe.exclude_physical_networks
        self.sync = Synchronizer(api_url, username, password, self.neutron_id,
                                 exclude_physical_networks)
        self.notifier = EventNotifier()
        self.watcher = EventWatcher()
        self.keystone_client = KeystoneClient()
        self.db_plugin = db_base_plugin_v2.NeutronDbPluginV2()

        eventlet.spawn(self.watcher.watch)
        eventlet.spawn(self._bcf_sync,
                       cfg.CONF.networking_bigswitch_l3_pe.sync_interval)
Пример #8
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)

        hash_handler = cdb.HashHandler()
        if hash_handler.is_db_hash_empty():
            LOG.debug("Forcing topology sync as consistency hash is empty")
            hash_handler.read_for_update()
            hash_handler.put_hash('initial:hash,code')

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data_auto
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        # Track hosts running IVS to avoid excessive calls to the backend
        self.vswitch_host_cache = {}
        self.setup_sg_rpc_callbacks()

        LOG.debug("Initialization done")
Пример #9
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)

        hash_handler = cdb.HashHandler()
        if hash_handler.is_db_hash_empty():
            LOG.debug("Forcing topology sync as consistency hash is empty")
            hash_handler.read_for_update()
            hash_handler.put_hash('initial:hash,code')

        # init network ctrl connections
        self.servers = servermanager.ServerPool()
        self.servers.get_topo_function = self._get_all_data_auto
        self.segmentation_types = ', '.join(cfg.CONF.ml2.type_drivers)
        # Track hosts running IVS to avoid excessive calls to the backend
        self.vswitch_host_cache = {}
        self.setup_sg_rpc_callbacks()

        LOG.debug("Initialization done")
 def setUp(self):
     pl_config.register_config()
     super(BaseAgentTestCase, self).setUp()
     self.mod_agent = importutils.import_module(AGENTMOD)
 def setUp(self):
     pl_config.register_config()
     super(BaseAgentTestCase, self).setUp()
     self.mod_agent = importutils.import_module(AGENTMOD)