当前位置: 首页>>代码示例>>Python>>正文


Python n1kv_db_v2.delete_network_profile函数代码示例

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


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

示例1: test_get_network_profile

 def test_get_network_profile(self):
     profile = n1kv_db_v2.create_network_profile(self.session,
                                                 TEST_NETWORK_PROFILE)
     got_profile = n1kv_db_v2.get_network_profile(self.session, profile.id)
     self.assertEqual(profile.id, got_profile.id)
     self.assertEqual(profile.name, got_profile.name)
     n1kv_db_v2.delete_network_profile(self.session, profile.id)
开发者ID:PFZheng,项目名称:neutron,代码行数:7,代码来源:test_n1kv_db.py

示例2: test_create_network_profile_overlap

    def test_create_network_profile_overlap(self):
        _db_profile = n1kv_db_v2.create_network_profile(self.session,
                                                        TEST_NETWORK_PROFILE_2)
        ctx = context.get_admin_context()
        TEST_NETWORK_PROFILE_2['name'] = 'net-profile-min-overlap'
        TEST_NETWORK_PROFILE_2['segment_range'] = SEGMENT_RANGE_MIN_OVERLAP
        test_net_profile = {'network_profile': TEST_NETWORK_PROFILE_2}
        self.assertRaises(n_exc.InvalidInput,
                          self.create_network_profile,
                          ctx,
                          test_net_profile)

        TEST_NETWORK_PROFILE_2['name'] = 'net-profile-max-overlap'
        TEST_NETWORK_PROFILE_2['segment_range'] = SEGMENT_RANGE_MAX_OVERLAP
        test_net_profile = {'network_profile': TEST_NETWORK_PROFILE_2}
        self.assertRaises(n_exc.InvalidInput,
                          self.create_network_profile,
                          ctx,
                          test_net_profile)

        TEST_NETWORK_PROFILE_2['name'] = 'net-profile-overlap'
        TEST_NETWORK_PROFILE_2['segment_range'] = SEGMENT_RANGE_OVERLAP
        test_net_profile = {'network_profile': TEST_NETWORK_PROFILE_2}
        self.assertRaises(n_exc.InvalidInput,
                          self.create_network_profile,
                          ctx,
                          test_net_profile)
        n1kv_db_v2.delete_network_profile(self.session, _db_profile.id)
开发者ID:PFZheng,项目名称:neutron,代码行数:28,代码来源:test_n1kv_db.py

示例3: test_vxlan_pool

    def test_vxlan_pool(self):
        vxlan_ids = set()
        profile = n1kv_db_v2.create_network_profile(self.session,
                                                    TEST_NETWORK_PROFILE_VXLAN)
        for x in xrange(VXLAN_MIN, VXLAN_MAX + 1):
            vxlan = n1kv_db_v2.reserve_vxlan(self.session, profile)
            vxlan_id = vxlan[2]
            self.assertThat(vxlan_id, matchers.GreaterThan(VXLAN_MIN - 1))
            self.assertThat(vxlan_id, matchers.LessThan(VXLAN_MAX + 1))
            vxlan_ids.add(vxlan_id)

        self.assertRaises(q_exc.NoNetworkAvailable,
                          n1kv_db_v2.reserve_vxlan,
                          self.session,
                          profile)
        n1kv_db_v2.release_vxlan(self.session, vxlan_ids.pop(), VXLAN_RANGES)
        vxlan = n1kv_db_v2.reserve_vxlan(self.session, profile)
        vxlan_id = vxlan[2]
        self.assertThat(vxlan_id, matchers.GreaterThan(VXLAN_MIN - 1))
        self.assertThat(vxlan_id, matchers.LessThan(VXLAN_MAX + 1))
        vxlan_ids.add(vxlan_id)

        for vxlan_id in vxlan_ids:
            n1kv_db_v2.release_vxlan(self.session, vxlan_id, VXLAN_RANGES)
        n1kv_db_v2.delete_network_profile(self.session, profile.id)
开发者ID:ChengZuo,项目名称:neutron,代码行数:25,代码来源:test_n1kv_db.py

示例4: test_update_network_profile

 def test_update_network_profile(self):
     TEST_PROFILE_1 = {'name': 'test_profile_1'}
     profile = _create_test_network_profile_if_not_there(self.session)
     updated_profile = n1kv_db_v2.update_network_profile(self.session,
                                                         profile.id,
                                                         TEST_PROFILE_1)
     self.assertEqual(updated_profile.name, TEST_PROFILE_1['name'])
     n1kv_db_v2.delete_network_profile(self.session, profile.id)
开发者ID:PFZheng,项目名称:neutron,代码行数:8,代码来源:test_n1kv_db.py

示例5: test_create_network_profile

 def test_create_network_profile(self):
     _db_profile = n1kv_db_v2.create_network_profile(self.session, TEST_NETWORK_PROFILE)
     self.assertIsNotNone(_db_profile)
     db_profile = (
         self.session.query(n1kv_models_v2.NetworkProfile).filter_by(name=TEST_NETWORK_PROFILE["name"]).one()
     )
     self.assertIsNotNone(db_profile)
     self.assertEqual(_db_profile.id, db_profile.id)
     self.assertEqual(_db_profile.name, db_profile.name)
     self.assertEqual(_db_profile.segment_type, db_profile.segment_type)
     self.assertEqual(_db_profile.segment_range, db_profile.segment_range)
     self.assertEqual(_db_profile.multicast_ip_index, db_profile.multicast_ip_index)
     self.assertEqual(_db_profile.multicast_ip_range, db_profile.multicast_ip_range)
     n1kv_db_v2.delete_network_profile(self.session, _db_profile.id)
开发者ID:gjholler,项目名称:neutron,代码行数:14,代码来源:test_n1kv_db.py

示例6: test_delete_network_profile

    def test_delete_network_profile(self):
        try:
            profile = (
                self.session.query(n1kv_models_v2.NetworkProfile).filter_by(name=TEST_NETWORK_PROFILE["name"]).one()
            )
        except s_exc.NoResultFound:
            profile = n1kv_db_v2.create_network_profile(self.session, TEST_NETWORK_PROFILE)

        n1kv_db_v2.delete_network_profile(self.session, profile.id)
        try:
            self.session.query(n1kv_models_v2.NetworkProfile).filter_by(name=TEST_NETWORK_PROFILE["name"]).one()
        except s_exc.NoResultFound:
            pass
        else:
            self.fail("Network Profile (%s) was not deleted" % TEST_NETWORK_PROFILE["name"])
开发者ID:gjholler,项目名称:neutron,代码行数:15,代码来源:test_n1kv_db.py

示例7: test_default_tenant_replace

 def test_default_tenant_replace(self):
     ctx = context.get_admin_context()
     ctx.tenant_id = "d434dd90-76ec-11e2-bcfd-0800200c9a66"
     test_profile_id = "AAAAAAAA-76ec-11e2-bcfd-0800200c9a66"
     test_profile_type = "policy"
     n1kv_db_v2.create_profile_binding(cisco_constants.TENANT_ID_NOT_SET,
                                       test_profile_id,
                                       test_profile_type)
     network_profile = {"network_profile": TEST_NETWORK_PROFILE}
     test_network_profile = self.create_network_profile(ctx,
                                                        network_profile)
     binding = n1kv_db_v2.get_profile_binding(ctx.tenant_id,
                                              test_profile_id)
     self.assertIsNone(n1kv_db_v2.get_profile_binding(
         cisco_constants.TENANT_ID_NOT_SET,
         test_profile_id))
     self.assertNotEqual(binding.tenant_id,
                         cisco_constants.TENANT_ID_NOT_SET)
     n1kv_db_v2.delete_network_profile(self.session,
                                       test_network_profile['id'])
开发者ID:ChengZuo,项目名称:neutron,代码行数:20,代码来源:test_n1kv_db.py

示例8: test_vxlan_pool

    def test_vxlan_pool(self):
        vxlan_ids = set()
        for x in moves.xrange(VXLAN_MIN, VXLAN_MAX + 1):
            vxlan = n1kv_db_v2.reserve_vxlan(self.session, self.net_p)
            vxlan_id = vxlan[2]
            self.assertThat(vxlan_id, matchers.GreaterThan(VXLAN_MIN - 1))
            self.assertThat(vxlan_id, matchers.LessThan(VXLAN_MAX + 1))
            vxlan_ids.add(vxlan_id)

        self.assertRaises(n_exc.NoNetworkAvailable, n1kv_db_v2.reserve_vxlan, self.session, self.net_p)
        n1kv_db_v2.release_vxlan(self.session, vxlan_ids.pop())
        vxlan = n1kv_db_v2.reserve_vxlan(self.session, self.net_p)
        vxlan_id = vxlan[2]
        self.assertThat(vxlan_id, matchers.GreaterThan(VXLAN_MIN - 1))
        self.assertThat(vxlan_id, matchers.LessThan(VXLAN_MAX + 1))
        vxlan_ids.add(vxlan_id)

        for vxlan_id in vxlan_ids:
            n1kv_db_v2.release_vxlan(self.session, vxlan_id)
        n1kv_db_v2.delete_network_profile(self.session, self.net_p.id)
开发者ID:gjholler,项目名称:neutron,代码行数:20,代码来源:test_n1kv_db.py


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