def __init__(self, configfile=None):
     self.extra_binding_dict = {
         portbindings.VIF_TYPE: portbindings.VIF_TYPE_OVS,
         portbindings.CAPABILITIES: {
             portbindings.CAP_PORT_FILTER:
             'security-group' in self.supported_extension_aliases}}
     ovs_db_v2.initialize()
     self._parse_network_vlan_ranges()
     ovs_db_v2.sync_vlan_allocations(self.network_vlan_ranges)
     self.tenant_network_type = cfg.CONF.OVS.tenant_network_type
     if self.tenant_network_type not in [constants.TYPE_LOCAL,
                                         constants.TYPE_VLAN,
                                         constants.TYPE_GRE,
                                         constants.TYPE_VXLAN,
                                         constants.TYPE_NONE]:
         LOG.error(_("Invalid tenant_network_type: %s. "
                   "Server terminated!"),
                   self.tenant_network_type)
         sys.exit(1)
     self.enable_tunneling = cfg.CONF.OVS.enable_tunneling
     self.tunnel_id_ranges = []
     if self.enable_tunneling:
         self._parse_tunnel_id_ranges()
         ovs_db_v2.sync_tunnel_allocations(self.tunnel_id_ranges)
     elif self.tenant_network_type in constants.TUNNEL_NETWORK_TYPES:
         LOG.error(_("Tunneling disabled but tenant_network_type is '%s'. "
                   "Server terminated!"), self.tenant_network_type)
         sys.exit(1)
     self.setup_rpc()
     self.network_scheduler = importutils.import_object(
         cfg.CONF.network_scheduler_driver
     )
     self.router_scheduler = importutils.import_object(
         cfg.CONF.router_scheduler_driver
     )
Esempio n. 2
0
 def __init__(self, configfile=None):
     self.base_binding_dict = {
         portbindings.VIF_TYPE: portbindings.VIF_TYPE_OVS,
         portbindings.CAPABILITIES: {
             portbindings.CAP_PORT_FILTER:
             'security-group' in self.supported_extension_aliases}}
     ovs_db_v2.initialize()
     self._parse_network_vlan_ranges()
     ovs_db_v2.sync_vlan_allocations(self.network_vlan_ranges)
     self.tenant_network_type = cfg.CONF.OVS.tenant_network_type
     if self.tenant_network_type not in [svc_constants.TYPE_LOCAL,
                                         svc_constants.TYPE_VLAN,
                                         svc_constants.TYPE_GRE,
                                         svc_constants.TYPE_VXLAN,
                                         svc_constants.TYPE_NONE]:
         LOG.error(_("Invalid tenant_network_type: %s. "
                   "Server terminated!"),
                   self.tenant_network_type)
         sys.exit(1)
     self.enable_tunneling = cfg.CONF.OVS.enable_tunneling
     self.tunnel_type = None
     if self.enable_tunneling:
         self.tunnel_type = (cfg.CONF.OVS.tunnel_type or
                             svc_constants.TYPE_GRE)
     elif cfg.CONF.OVS.tunnel_type:
         self.tunnel_type = cfg.CONF.OVS.tunnel_type
         self.enable_tunneling = True
     self.tunnel_id_ranges = []
     if self.enable_tunneling:
         self._parse_tunnel_id_ranges()
         ovs_db_v2.sync_tunnel_allocations(self.tunnel_id_ranges)
     elif self.tenant_network_type in constants.TUNNEL_NETWORK_TYPES:
         LOG.error(_("Tunneling disabled but tenant_network_type is '%s'. "
                   "Server terminated!"), self.tenant_network_type)
         sys.exit(1)
     self.setup_rpc()
     self.network_scheduler = importutils.import_object(
         cfg.CONF.network_scheduler_driver
     )
     self.router_scheduler = importutils.import_object(
         cfg.CONF.router_scheduler_driver
     )
 def setUp(self):
     super(VlanAllocationsTest, self).setUp()
     ovs_db_v2.initialize()
     ovs_db_v2.sync_vlan_allocations(VLAN_RANGES)
     self.session = db.get_session()
     self.addCleanup(db.clear_db)
 def setUp(self):
     super(NetworkBindingsTest, self).setUp()
     ovs_db_v2.initialize()
     self.session = db.get_session()
 def setUp(self):
     super(TunnelAllocationsTest, self).setUp()
     ovs_db_v2.initialize()
     ovs_db_v2.sync_tunnel_allocations(TUNNEL_RANGES)
     self.session = db.get_session()
     self.addCleanup(db.clear_db)
Esempio n. 6
0
 def setUp(self):
     cfg.CONF.set_override('network_vlan_ranges', ['physnet1:1000:2999'],
                           group='OVS')
     super(NetworkBindingsTest, self).setUp(plugin=PLUGIN_NAME)
     ovs_db_v2.initialize()
     self.session = db.get_session()
Esempio n. 7
0
 def setUp(self):
     super(VlanAllocationsTest, self).setUp()
     ovs_db_v2.initialize()
     ovs_db_v2.sync_vlan_allocations(VLAN_RANGES)
     self.session = db.get_session()
     self.addCleanup(db.clear_db)
Esempio n. 8
0
 def setUp(self):
     super(NetworkBindingsTest, self).setUp()
     ovs_db_v2.initialize()
     self.session = db.get_session()
Esempio n. 9
0
 def setUp(self):
     super(TunnelAllocationsTest, self).setUp()
     ovs_db_v2.initialize()
     ovs_db_v2.sync_tunnel_allocations(TUNNEL_RANGES)
     self.session = db.get_session()
     self.addCleanup(db.clear_db)