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


Python db.console_pool_get_by_host_type函数代码示例

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


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

示例1: test_add_console

    def test_add_console(self):
        instance = self._create_instance()
        self.console.add_console(self.context, instance["id"])
        instance = db.instance_get(self.context, instance["id"])
        pool = db.console_pool_get_by_host_type(
            self.context, instance["host"], self.console.host, self.console.driver.console_type
        )

        console_instances = [con["instance_uuid"] for con in pool["consoles"]]
        self.assert_(instance["uuid"] in console_instances)
        db.instance_destroy(self.context, instance["uuid"])
开发者ID:tr3buchet,项目名称:nova,代码行数:11,代码来源:test_console.py

示例2: test_add_console

    def test_add_console(self):
        instance = self._create_instance()
        self.console.add_console(self.context, instance['id'])
        instance = db.instance_get(self.context, instance['id'])
        pool = db.console_pool_get_by_host_type(self.context,
                instance['host'], self.console.host,
                self.console.driver.console_type)

        console_instances = [con['instance_uuid'] for con in pool['consoles']]
        self.assert_(instance['uuid'] in console_instances)
        db.instance_destroy(self.context, instance['uuid'])
开发者ID:Charu-Sharma,项目名称:nova,代码行数:11,代码来源:test_console.py

示例3: test_add_console

    def test_add_console(self, mock_get):
        mock_get.return_value = self.pool_info
        instance = self._create_instance()
        self.console.add_console(self.context, instance['id'])
        instance = db.instance_get(self.context, instance['id'])
        pool = db.console_pool_get_by_host_type(self.context,
                instance['host'], self.console.host,
                self.console.driver.console_type)

        console_instances = [con['instance_uuid'] for con in pool['consoles']]
        self.assertIn(instance['uuid'], console_instances)
        db.instance_destroy(self.context, instance['uuid'])
开发者ID:BeyondTheClouds,项目名称:nova,代码行数:12,代码来源:test_console.py

示例4: test_get_pool_creates_new_pool_if_needed

 def test_get_pool_creates_new_pool_if_needed(self):
     self.assertRaises(
         exception.NotFound,
         db.console_pool_get_by_host_type,
         self.context,
         self.host,
         self.console.host,
         self.console.driver.console_type,
     )
     pool = self.console.get_pool_for_instance_host(self.context, self.host)
     pool2 = db.console_pool_get_by_host_type(
         self.context, self.host, self.console.host, self.console.driver.console_type
     )
     self.assertEqual(pool["id"], pool2["id"])
开发者ID:tr3buchet,项目名称:nova,代码行数:14,代码来源:test_console.py

示例5: test_get_pool_creates_new_pool_if_needed

 def test_get_pool_creates_new_pool_if_needed(self, mock_get):
     mock_get.return_value = self.pool_info
     self.assertRaises(exception.NotFound,
                       db.console_pool_get_by_host_type,
                       self.context,
                       self.host,
                       self.console.host,
                       self.console.driver.console_type)
     pool = self.console._get_pool_for_instance_host(self.context,
                                                        self.host)
     pool2 = db.console_pool_get_by_host_type(self.context,
                           self.host,
                           self.console.host,
                           self.console.driver.console_type)
     self.assertEqual(pool['id'], pool2['id'])
开发者ID:BeyondTheClouds,项目名称:nova,代码行数:15,代码来源:test_console.py


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