本文整理汇总了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')
示例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')
示例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
示例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
示例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
示例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')
示例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')
示例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')
示例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)
示例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')
示例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')
示例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')
示例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')
示例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')