當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。