Exemplo n.º 1
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(cfg.CONF.VLANS.network_vlan_ranges)
     except Exception as ex:
         LOG.error(_("%s. Agent terminated!"), ex)
         sys.exit(1)
     LOG.info(_("Network VLAN ranges: %s"), self.network_vlan_ranges)
Exemplo n.º 2
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.MLNX.network_vlan_ranges)
     except Exception as ex:
         LOG.error(_("%s. Server terminated!"), ex)
         sys.exit(1)
     LOG.info(_("Network VLAN ranges: %s"), self.network_vlan_ranges)
Exemplo n.º 3
0
 def _creat_networks(self):
     self._maps = plugin_utils.parse_network_vlan_ranges(
                         CONF.ml2_type_vlan.network_vlan_ranges
                         + CONF.ml2_type_flat.flat_networks)
     self._vsws = []
     for vsw in self._maps.keys():
         CONF.register_opts(vswitch_opts, vsw)
         self._vsws.append(zvmVswitch(self._zhcp, vsw, self._maps[vsw]))
Exemplo n.º 4
0
 def setUp(self):
     super(VlanTypeTest, self).setUp()
     cfg.CONF.set_override('network_vlan_ranges', NETWORK_VLAN_RANGES,
                           group='ml2_type_vlan')
     self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         NETWORK_VLAN_RANGES)
     self.driver = type_vlan.VlanTypeDriver()
     self.driver._sync_vlan_allocations()
     self.session = db.get_session()
Exemplo n.º 5
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.ml2_type_vlan.network_vlan_ranges)
     except Exception:
         LOG.exception(_LE("Failed to parse network_vlan_ranges. "
                           "Service terminated!"))
         sys.exit(1)
     LOG.info(_LI("Network VLAN ranges: %s"), self.network_vlan_ranges)
Exemplo n.º 6
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.ml2_type_vlan.network_vlan_ranges)
     except Exception:
         LOG.exception("Failed to parse network_vlan_ranges. "
                       "Service terminated!")
         sys.exit(1)
     LOG.info("Network VLAN ranges: %s", self.network_vlan_ranges)
Exemplo n.º 7
0
 def _is_vlan_tenant_network(self, provider_net):
     network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(cfg.CONF.ml2_type_vlan.network_vlan_ranges)
     vlan_ranges = network_vlan_ranges[provider_net["physical_network"]]
     if not vlan_ranges:
         return False
     segmentation_id = int(provider_net["segmentation_id"])
     for vlan_range in vlan_ranges:
         if vlan_range[0] <= segmentation_id <= vlan_range[1]:
             return True
Exemplo n.º 8
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.tricircle.network_vlan_ranges)
     except Exception:
         LOG.exception(_LE('Failed to parse network_vlan_ranges. '
                           'Service terminated!'))
         sys.exit(1)
     LOG.info(_LI('Network VLAN ranges: %s'), self.network_vlan_ranges)
Exemplo n.º 9
0
 def _is_vlan_tenant_network(self, provider_net):
     network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         cfg.CONF.ml2_type_vlan.network_vlan_ranges)
     vlan_ranges = network_vlan_ranges[provider_net['physical_network']]
     if not vlan_ranges:
         return False
     segmentation_id = int(provider_net['segmentation_id'])
     for vlan_range in vlan_ranges:
         if vlan_range[0] <= segmentation_id <= vlan_range[1]:
             return True
Exemplo n.º 10
0
 def setUp(self):
     super(VlanTypeTest, self).setUp()
     cfg.CONF.set_override('network_vlan_ranges',
                           NETWORK_VLAN_RANGES,
                           group='ml2_type_vlan')
     self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         NETWORK_VLAN_RANGES)
     self.driver = type_vlan.VlanTypeDriver()
     self.driver._sync_vlan_allocations()
     self.session = db.get_session()
Exemplo n.º 11
0
 def setUp(self):
     super(VlanTypeTest, self).setUp()
     config.cfg.CONF.set_override('network_vlan_ranges',
                                  NETWORK_VLAN_RANGES,
                                  group='ml2_type_vlan')
     self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         NETWORK_VLAN_RANGES)
     self.driver = type_vlan.VlanTypeDriver()
     self.driver._sync_vlan_allocations()
     self.context = context.Context()
     self.driver.physnet_mtus = []
Exemplo n.º 12
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.ml2_type_vlan.network_vlan_ranges)
         # TODO(rkukura): Validate that each physical_network name
         # is neither empty nor too long.
     except Exception:
         LOG.exception(_("Failed to parse network_vlan_ranges. "
                         "Service terminated!"))
         sys.exit(1)
     LOG.info(_("Network VLAN ranges: %s"), self.network_vlan_ranges)
Exemplo n.º 13
0
 def _parse_network_vlan_ranges(self):
     try:
         self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
             cfg.CONF.ml2_type_vlan.network_vlan_ranges)
         # TODO(rkukura): Validate that each physical_network name
         # is neither empty nor too long.
     except Exception:
         LOG.exception(_("Failed to parse network_vlan_ranges. "
                         "Service terminated!"))
         sys.exit(1)
     LOG.info(_("Network VLAN ranges: %s"), self.network_vlan_ranges)
Exemplo n.º 14
0
 def _creat_networks(self):
     admin_vsw = self._utils.get_admin_created_vsw(self._zhcp)
     self._maps = plugin_utils.parse_network_vlan_ranges(
         CONF.ml2_type_vlan.network_vlan_ranges +
         CONF.ml2_type_flat.flat_networks)
     self._vsws = []
     for vsw in self._maps.keys():
         CONF.register_opts(vswitch_opts, vsw)
         if vsw.upper() in admin_vsw:
             LOG.info('Vswitch %s is pre-created by admin or system, '
                      'neutron-zvm-agent will not handle it' % vsw)
         else:
             self._vsws.append(zvmVswitch(self._zhcp, vsw, self._maps[vsw]))
Exemplo n.º 15
0
    def __init__(self):
        LOG.debug("Initializing OpenDaylight ML2 driver")
        self.client = odl_client.OpenDaylightRestClient(
            cfg.CONF.ml2_odl.url,
            cfg.CONF.ml2_odl.username,
            cfg.CONF.ml2_odl.password,
            cfg.CONF.ml2_odl.timeout
        )
        self.sec_handler = odl_call.OdlSecurityGroupsHandler(self)

        #add by hqf: get provider network
        self.network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
                cfg.CONF.ml2_type_vlan.network_vlan_ranges)
        self.physical_network = self.get_physical_network()
Exemplo n.º 16
0
 def parse_vlan_ranges(self, vlan_range):
     return plugin_utils.parse_network_vlan_ranges(vlan_range)
 def parse_list(self, cfg_entries):
     return plugin_utils.parse_network_vlan_ranges(cfg_entries)
Exemplo n.º 18
0
 def _parse_network_vlan_ranges(self):
     self._network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         cfg.CONF.HYPERV.network_vlan_ranges)
     LOG.info(_("Network VLAN ranges: %s"), self._network_vlan_ranges)
Exemplo n.º 19
0
 def parse_list(self, cfg_entries):
     return plugin_utils.parse_network_vlan_ranges(cfg_entries)
Exemplo n.º 20
0
 def _parse_network_vlan_ranges(self):
     self._network_vlan_ranges = plugin_utils.parse_network_vlan_ranges(
         cfg.CONF.HYPERV.network_vlan_ranges)
     LOG.info(_("Network VLAN ranges: %s"), self._network_vlan_ranges)
 def parse_vlan_ranges(self, vlan_range):
     return plugin_utils.parse_network_vlan_ranges(vlan_range)