Пример #1
0
 def setUp(self):
     service_plugins = {'TAG': "neutron.services.tag.tag_plugin.TagPlugin"}
     super(TestTagApiBase, self).setUp(service_plugins=service_plugins)
     plugin = tag_plugin.TagPlugin()
     ext_mgr = extensions.PluginAwareExtensionManager(
         extensions_path, {'TAG': plugin})
     app = config.load_paste_app('extensions_test_app')
     self.ext_api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
Пример #2
0
    def __init__(
        self,
        minimize_polling=False,
        quitting_rpc_timeout=None,
        conf=None,
        aci_monitor_respawn_interval=(aci_constants.DEFAULT_ACI_RESPAWN)):

        self.conf = aci_config.CONF

        self.aci_config = self.conf.ml2_aci

        self.network_config = {
            'hostgroup_dict': aci_config.create_hostgroup_dictionary(),
            'address_scope_dict': aci_config.create_addressscope_dictionary()
        }

        self.host_group_config = self.network_config['hostgroup_dict']
        self.tenant_manager = driver.DriverManager(
            namespace='aci.tenant.managers',
            name=self.aci_config.tenant_manager,
            invoke_on_load=True).driver

        self.db = db.NeutronDbPluginV2()
        self.tag_plugin = tag_plugin.TagPlugin()

        self.aci_manager = cobra_manager.CobraManager(self.network_config,
                                                      self.aci_config,
                                                      self.tenant_manager)

        self.aci_monitor_respawn_interval = aci_monitor_respawn_interval
        self.minimize_polling = minimize_polling,
        self.polling_interval = 10
        self.iter_num = 0
        self.run_daemon_loop = True
        self.quitting_rpc_timeout = quitting_rpc_timeout
        self.catch_sigterm = False
        self.catch_sighup = False

        host = self.conf.host
        self.agent_id = 'aci-agent-%s' % host

        self.setup_rpc()

        self.agent_state = {
            'binary': 'neutron-aci-agent',
            'host': host,
            'topic': n_const.L2_AGENT_TOPIC,
            'configurations': {},
            'agent_type': aci_constants.ACI_AGENT_TYPE,
            'start_flag': True
        }

        self.connection.consume_in_threads()
Пример #3
0
 def setUp(self):
     service_plugins = {
         'TAG':
         "neutron.services.tag.tag_plugin.TagPlugin",
         'router':
         "neutron.tests.unit.extensions.test_l3.TestL3NatServicePlugin"
     }
     super(TestTagApiBase, self).setUp(service_plugins=service_plugins)
     plugin = tag_plugin.TagPlugin()
     l3_plugin = test_l3.TestL3NatServicePlugin()
     ext_mgr = extensions.PluginAwareExtensionManager(
         extensions_path, {
             'router': l3_plugin,
             'TAG': plugin
         })
     ext_mgr.extend_resources("2.0", attributes.RESOURCE_ATTRIBUTE_MAP)
     app = config.load_paste_app('extensions_test_app')
     self.ext_api = extensions.ExtensionMiddleware(app, ext_mgr=ext_mgr)
Пример #4
0
    def __init__(self, conf, network_id, mode):
        self.network_id = network_id
        self.mode = mode

        #Set up is similar to agent - need to review if compatible and how to refactor
        self.conf = conf

        self.aci_config = self.conf.ml2_aci

        self.conf.log_opt_values(LOG, logging.DEBUG)

        self.network_config = {
            'hostgroup_dict': aci_config.create_hostgroup_dictionary(),
            'address_scope_dict': aci_config.create_addressscope_dictionary()
        }

        self.host_group_config = self.network_config['hostgroup_dict']
        self.tenant_manager = driver.DriverManager(
            namespace='aci.tenant.managers',
            name=self.aci_config.tenant_manager,
            invoke_on_load=True).driver

        self.db = DbPlugin()  #db.NeutronDbPluginV2()
        self.tag_plugin = tag_plugin.TagPlugin()

        self.aci_manager = cobra_manager.CobraManager(self.network_config,
                                                      self.aci_config,
                                                      self.tenant_manager)

        self.context = context.get_admin_context()

        self.network = None
        self.external = False
        self.orphan = False
        self.tenant_mismatch = False
        self.tagged_tenant = None
        self.tenant = None
        self.missing_tenant = True
        self.bd = None
        self.epg = None
        self.bd_config = {}
        self.epg_config = {}
        self.bindings = []