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


Python waiters.wait_for_server_status方法代码示例

本文整理汇总了Python中tempest.common.waiters.wait_for_server_status方法的典型用法代码示例。如果您正苦于以下问题:Python waiters.wait_for_server_status方法的具体用法?Python waiters.wait_for_server_status怎么用?Python waiters.wait_for_server_status使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tempest.common.waiters的用法示例。


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

示例1: rebuild_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def rebuild_server(self, server_id, image=None,
                       preserve_ephemeral=False, wait=True,
                       rebuild_kwargs=None):
        if image is None:
            image = CONF.compute.image_ref

        rebuild_kwargs = rebuild_kwargs or {}

        LOG.debug("Rebuilding server (id: %s, image: %s, preserve eph: %s)",
                  server_id, image, preserve_ephemeral)
        self.servers_client.rebuild_server(
            server_id=server_id, image_ref=image,
            preserve_ephemeral=preserve_ephemeral,
            **rebuild_kwargs)
        if wait:
            waiters.wait_for_server_status(self.servers_client,
                                           server_id, 'ACTIVE') 
开发者ID:openstack,项目名称:vmware-nsx-tempest-plugin,代码行数:19,代码来源:manager.py

示例2: rebuild_instance

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def rebuild_instance(self, preserve_ephemeral=False):
        self.rebuild_server(server_id=self.instance['id'],
                            preserve_ephemeral=preserve_ephemeral,
                            wait=False)

        node = self.get_node(instance_id=self.instance['id'])

        # We should remain on the same node
        self.assertEqual(self.node['uuid'], node['uuid'])
        self.node = node

        waiters.wait_for_server_status(
            self.servers_client,
            server_id=self.instance['id'],
            status='REBUILD',
            ready_wait=False)
        waiters.wait_for_server_status(
            self.servers_client,
            server_id=self.instance['id'],
            status='ACTIVE') 
开发者ID:openstack,项目名称:ironic-tempest-plugin,代码行数:22,代码来源:test_baremetal_basic_ops.py

示例3: _create_nova_instance

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _create_nova_instance(self, flavor=None, image=None, cleanup=True):
        if flavor is None:
            flavor = CONF.compute.flavor_ref
        if image is None:
            image = CONF.compute.image_ref

        name = data_utils.rand_name("instance")
        net_id = CONF.network.public_network_id
        networks = [{'uuid': net_id}]
        server = self.servers_client.create_server(name=name,
                                                   imageRef=image,
                                                   flavorRef=flavor,
                                                   networks=networks)['server']
        server_id = server['id']

        if cleanup:
            self.addCleanup(self.servers_client.delete_server, server_id)

        waiters.wait_for_server_status(self.servers_client, server_id,
                                       'ACTIVE')
        return server_id 
开发者ID:redhat-openstack,项目名称:whitebox-tempest-plugin,代码行数:23,代码来源:base.py

示例4: _rebuild_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _rebuild_server(self):
        server, flavor = self.create_test_server(wait_until='ACTIVE')
        image = self._prepare_image()

        self.os_primary.servers_client.rebuild_server(server['id'],
                                                      image['id'])
        waiters.wait_for_server_status(self.os_primary.servers_client,
                                       server['id'],
                                       status='ACTIVE')

        self.addCleanup(waiters.wait_for_server_termination,
                        self.os_primary.servers_client, server['id'])
        self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                        self.os_primary.servers_client.delete_server,
                        server['id'])

        return server, flavor 
开发者ID:openstack,项目名称:almanach,代码行数:19,代码来源:test_server_rebuild.py

示例5: _resize_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _resize_server(self):
        flavors = self.flavors_client.list_flavors()['flavors']
        resized_flavor = flavors[1]
        server, initial_flavor = self.create_test_server(wait_until='ACTIVE')
        self.os_primary.servers_client.resize_server(server['id'],
                                                     resized_flavor['id'])

        waiters.wait_for_server_status(self.os_primary.servers_client,
                                       server['id'],
                                       status='VERIFY_RESIZE')

        self.os_primary.servers_client.confirm_resize_server(server['id'])

        waiters.wait_for_server_status(self.os_primary.servers_client,
                                       server['id'],
                                       status='ACTIVE')

        self.addCleanup(waiters.wait_for_server_termination,
                        self.os_primary.servers_client, server['id'])
        self.addCleanup(test_utils.call_and_ignore_notfound_exc,
                        self.os_primary.servers_client.delete_server,
                        server['id'])

        return server, initial_flavor, resized_flavor 
开发者ID:openstack,项目名称:almanach,代码行数:26,代码来源:test_server_resize.py

示例6: wait_for_servers_become_active

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def wait_for_servers_become_active(self, servers, client=None):
        servers_client = client or self.admin_manager.servers_client
        net_id_list = servers.keys()
        for net_id in net_id_list:
            nsv = self.tp_svrs[net_id]
            serv = nsv['server']
            waiters.wait_for_server_status(
                servers_client, serv['id'], 'ACTIVE')
            # update server context. A server might not have ip address
            # if not in running/active state
            act_server = servers_client.show_server(serv['id'])
            self.tp_svrs[net_id]['server'] = act_server.get('server',
                                                            act_server) 
开发者ID:openstack,项目名称:vmware-nsx-tempest-plugin,代码行数:15,代码来源:test_multiple_transport_zones_basic_ops.py

示例7: wait_for_servers_become_active

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def wait_for_servers_become_active(self, server_list):
        for serv in server_list:
            waiters.wait_for_server_status(
                self.manager.servers_client,
                serv['id'], 'ACTIVE') 
开发者ID:openstack,项目名称:vmware-nsx-tempest-plugin,代码行数:7,代码来源:test_lbaas_round_robin_ops.py

示例8: wait_for_servers_become_active

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def wait_for_servers_become_active(self):
        servers_client = self.cmgr_adm.servers_client
        for server_id in self.server_id_list:
            waiters.wait_for_server_status(
                servers_client, server_id, 'ACTIVE') 
开发者ID:openstack,项目名称:vmware-nsx-tempest-plugin,代码行数:7,代码来源:test_admin_policy_basic_ops.py

示例9: wait_for_servers_become_active

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def wait_for_servers_become_active(self, server_id_list,
                                       servers_client):
        for server_id in server_id_list:
            waiters.wait_for_server_status(
                servers_client, server_id, 'ACTIVE') 
开发者ID:openstack,项目名称:vmware-nsx-tempest-plugin,代码行数:7,代码来源:test_xnet_multiple_subnets_basic_ops.py

示例10: setUp

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def setUp(self):
        super(ServerActionsRbacTest, self).setUp()
        try:
            waiters.wait_for_server_status(self.servers_client,
                                           self.server_id, 'ACTIVE')
        except lib_exc.NotFound:
            # If the server was found to be deleted by a previous test,
            # a new one is built
            server = self.create_test_server(wait_until='ACTIVE')
            self.__class__.server_id = server['id']
        except Exception:
            # Recreating the server in case something happened during a test
            self.__class__.server_id = self.recreate_server(self.server_id) 
开发者ID:openstack,项目名称:patrole,代码行数:15,代码来源:test_server_actions_rbac.py

示例11: _stop_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _stop_server(self):
        self.servers_client.stop_server(self.server_id)
        waiters.wait_for_server_status(
            self.os_admin.servers_client, self.server_id, 'SHUTOFF') 
开发者ID:openstack,项目名称:patrole,代码行数:6,代码来源:test_server_actions_rbac.py

示例12: _resize_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _resize_server(self, flavor):
        self.servers_client.resize_server(self.server_id, flavor)
        waiters.wait_for_server_status(
            self.os_admin.servers_client, self.server_id, 'VERIFY_RESIZE') 
开发者ID:openstack,项目名称:patrole,代码行数:6,代码来源:test_server_actions_rbac.py

示例13: _confirm_resize_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _confirm_resize_server(self):
        self.servers_client.confirm_resize_server(self.server_id)
        waiters.wait_for_server_status(
            self.os_admin.servers_client, self.server_id, 'ACTIVE') 
开发者ID:openstack,项目名称:patrole,代码行数:6,代码来源:test_server_actions_rbac.py

示例14: _shelve_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def _shelve_server(self):
        self.servers_client.shelve_server(self.server_id)
        self.addCleanup(self._cleanup_server_actions,
                        self.servers_client.unshelve_server,
                        self.server_id)
        offload_time = CONF.compute.shelved_offload_time
        if offload_time >= 0:
            waiters.wait_for_server_status(self.os_admin.servers_client,
                                           self.server_id,
                                           'SHELVED_OFFLOADED',
                                           extra_timeout=offload_time)
        else:
            waiters.wait_for_server_status(self.os_admin.servers_client,
                                           self.server_id, 'SHELVED') 
开发者ID:openstack,项目名称:patrole,代码行数:16,代码来源:test_server_actions_rbac.py

示例15: test_unpause_server

# 需要导入模块: from tempest.common import waiters [as 别名]
# 或者: from tempest.common.waiters import wait_for_server_status [as 别名]
def test_unpause_server(self):
        self._pause_server()
        self.rbac_utils.switch_role(self, toggle_rbac_role=True)
        self.servers_client.unpause_server(self.server_id)
        waiters.wait_for_server_status(
            self.os_admin.servers_client, self.server_id, 'ACTIVE') 
开发者ID:openstack,项目名称:patrole,代码行数:8,代码来源:test_server_actions_rbac.py


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