• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python n1kv_db_v2.get_vlan_allocation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中neutron.plugins.cisco.db.n1kv_db_v2.get_vlan_allocation函数的典型用法代码示例。如果您正苦于以下问题:Python get_vlan_allocation函数的具体用法?Python get_vlan_allocation怎么用?Python get_vlan_allocation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_vlan_allocation函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_specific_vlan_inside_pool

    def test_specific_vlan_inside_pool(self):
        vlan_id = VLAN_MIN + 5
        self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session, PHYS_NET, vlan_id).allocated)
        n1kv_db_v2.reserve_specific_vlan(self.session, PHYS_NET, vlan_id)
        self.assertTrue(n1kv_db_v2.get_vlan_allocation(self.session, PHYS_NET, vlan_id).allocated)

        self.assertRaises(n_exc.VlanIdInUse, n1kv_db_v2.reserve_specific_vlan, self.session, PHYS_NET, vlan_id)

        n1kv_db_v2.release_vlan(self.session, PHYS_NET, vlan_id)
        self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session, PHYS_NET, vlan_id).allocated)
开发者ID:gjholler,项目名称:neutron,代码行数:10,代码来源:test_n1kv_db.py


示例2: test_create_network_profile_populate_vlan_segment_pool

 def test_create_network_profile_populate_vlan_segment_pool(self):
     db_session = db.get_session()
     net_p_dict = self._prepare_net_profile_data("vlan")
     net_p_req = self.new_create_request("network_profiles", net_p_dict)
     self.deserialize(self.fmt, net_p_req.get_response(self.ext_api))
     for vlan in range(VLAN_MIN, VLAN_MAX + 1):
         self.assertIsNotNone(n1kv_db_v2.get_vlan_allocation(db_session, PHYS_NET, vlan))
         self.assertFalse(n1kv_db_v2.get_vlan_allocation(db_session, PHYS_NET, vlan).allocated)
     self.assertRaises(c_exc.VlanIDNotFound, n1kv_db_v2.get_vlan_allocation, db_session, PHYS_NET, VLAN_MIN - 1)
     self.assertRaises(c_exc.VlanIDNotFound, n1kv_db_v2.get_vlan_allocation, db_session, PHYS_NET, VLAN_MAX + 1)
开发者ID:dreamhost,项目名称:quantum,代码行数:10,代码来源:test_n1kv_plugin.py


示例3: test_sync_vlan_allocations_unallocated_vlans

 def test_sync_vlan_allocations_unallocated_vlans(self):
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN).allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN + 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MAX - 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MAX).allocated)
开发者ID:PFZheng,项目名称:neutron,代码行数:15,代码来源:test_n1kv_db.py


示例4: test_create_network_rollback_deallocate_vlan_segment

 def test_create_network_rollback_deallocate_vlan_segment(self):
     """Test vlan segment deallocation on network create failure."""
     profile_obj = self._make_test_profile(name='test_profile',
                                           segment_range='20-23')
     data = self._prepare_net_data(profile_obj.id)
     client_patch = mock.patch(n1kv_client.__name__ + ".Client",
                               new=fake_client.TestClientInvalidResponse)
     client_patch.start()
     self.new_create_request('networks', data)
     db_session = db.get_session()
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(db_session,
                                                     PHYS_NET,
                                                     20).allocated)
开发者ID:AsherBond,项目名称:quantum,代码行数:13,代码来源:test_n1kv_plugin.py


示例5: test_delete_network_profile_deallocate_vlan_segment_pool

 def test_delete_network_profile_deallocate_vlan_segment_pool(self):
     db_session = db.get_session()
     net_p_dict = self._prepare_net_profile_data('vlan')
     net_p_req = self.new_create_request('network_profiles', net_p_dict)
     net_p = self.deserialize(self.fmt,
                              net_p_req.get_response(self.ext_api))
     self.assertIsNotNone(n1kv_db_v2.get_vlan_allocation(db_session,
                                                         PHYS_NET,
                                                         VLAN_MIN))
     self._delete('network_profiles', net_p['network_profile']['id'])
     for vlan in range(VLAN_MIN, VLAN_MAX + 1):
         self.assertRaises(c_exc.VlanIDNotFound,
                           n1kv_db_v2.get_vlan_allocation,
                           db_session,
                           PHYS_NET,
                           vlan)
开发者ID:aignatov,项目名称:neutron,代码行数:16,代码来源:test_n1kv_plugin.py


示例6: test_specific_vlan_outside_pool

    def test_specific_vlan_outside_pool(self):
        vlan_id = VLAN_MAX + 5
        self.assertRaises(c_exc.VlanIDNotFound,
                          n1kv_db_v2.get_vlan_allocation,
                          self.session,
                          PHYS_NET,
                          vlan_id)
        n1kv_db_v2.reserve_specific_vlan(self.session, PHYS_NET, vlan_id)
        self.assertTrue(n1kv_db_v2.get_vlan_allocation(self.session, PHYS_NET,
                                                       vlan_id).allocated)

        self.assertRaises(q_exc.VlanIdInUse,
                          n1kv_db_v2.reserve_specific_vlan,
                          self.session,
                          PHYS_NET,
                          vlan_id)

        n1kv_db_v2.release_vlan(self.session, PHYS_NET, vlan_id, VLAN_RANGES)
        self.assertRaises(c_exc.VlanIDNotFound,
                          n1kv_db_v2.get_vlan_allocation,
                          self.session,
                          PHYS_NET,
                          vlan_id)
开发者ID:ChengZuo,项目名称:neutron,代码行数:23,代码来源:test_n1kv_db.py


示例7: test_sync_vlan_allocations_unallocated_vlans

 def test_sync_vlan_allocations_unallocated_vlans(self):
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN).allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN + 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MAX - 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MAX).allocated)
     n1kv_db_v2.sync_vlan_allocations(self.session, UPDATED_VLAN_RANGES)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN + 20).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MIN + 20 + 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET,
                                                     VLAN_MAX + 20 - 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session, PHYS_NET,
                                                     VLAN_MAX + 20).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET_2,
                                                     VLAN_MIN + 40).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET_2,
                                                     VLAN_MIN + 40 + 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET_2,
                                                     VLAN_MAX + 40 - 1).
                      allocated)
     self.assertFalse(n1kv_db_v2.get_vlan_allocation(self.session,
                                                     PHYS_NET_2,
                                                     VLAN_MAX + 40).
                      allocated)
开发者ID:ChengZuo,项目名称:neutron,代码行数:47,代码来源:test_n1kv_db.py



注:本文中的neutron.plugins.cisco.db.n1kv_db_v2.get_vlan_allocation函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utils.create_port函数代码示例发布时间:2022-05-27
下一篇:
Python n1kv_db_v2.get_network_binding函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap