本文整理汇总了Python中neutron.plugins.common.utils.parse_network_vlan_ranges函数的典型用法代码示例。如果您正苦于以下问题:Python parse_network_vlan_ranges函数的具体用法?Python parse_network_vlan_ranges怎么用?Python parse_network_vlan_ranges使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了parse_network_vlan_ranges函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _parse_network_vlan_ranges
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)
示例2: _creat_networks
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]))
示例3: _parse_network_vlan_ranges
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)
示例4: setUp
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()
示例5: _is_vlan_tenant_network
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
示例6: _parse_network_vlan_ranges
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)
示例7: parse_list
def parse_list(self, cfg_entries):
return plugin_utils.parse_network_vlan_ranges(cfg_entries)
示例8: parse_vlan_ranges
def parse_vlan_ranges(self, vlan_range):
return plugin_utils.parse_network_vlan_ranges(vlan_range)
示例9: _parse_network_vlan_ranges
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)