def _delete_floating_ip(self, floating_ip): """Delete (deallocate) a floating ip for a tenant :param floating_ip: The floating ip address to delete. """ self.clients("nova").floating_ips.delete(floating_ip) bench_utils.wait_for_delete( floating_ip, update_resource=bench_utils.get_from_manager())
def _delete_floating_ip(self, floating_ip): """Delete (deallocate) a floating ip for a tenant :param floating_ip: The floating ip address to delete. """ self.clients("nova").floating_ips.delete(floating_ip) bench_utils.wait_for_delete( floating_ip, update_resource=bench_utils.get_from_manager() )
def _delete_share_network(self, share_network): """Delete share network. :param share_network: instance of :class:`ShareNetwork`. """ share_network.delete() bench_utils.wait_for_delete( share_network, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.manila_share_delete_timeout, check_interval=CONF.benchmark.manila_share_delete_poll_interval)
def _delete_security_service(self, security_service): """Delete security service. :param security_service: instance of :class:`SecurityService`. """ security_service.delete() bench_utils.wait_for_delete( security_service, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.manila_share_delete_timeout, check_interval=CONF.benchmark.manila_share_delete_poll_interval)
def _delete_share(self, share): """Delete the given share. :param share: :class:`Share` """ share.delete() error_statuses = ("error_deleting", ) bench_utils.wait_for_delete( share, update_resource=bench_utils.get_from_manager(error_statuses), timeout=CONF.benchmark.manila_share_delete_timeout, check_interval=CONF.benchmark.manila_share_delete_poll_interval)
def delete_floating_ip(self, fip_id, wait=False): """Delete floating IP. :param fip_id: int floating IP id :param wait: if True then wait to return until floating ip is deleted """ self.client.floating_ips.delete(fip_id) if not wait: return bench_utils.wait_for_delete( fip_id, update_resource=lambda i: self._get_floating_ip(i, do_raise=True))
def _delete_snapshot(self, snapshot): """Delete the given snapshot. Returns when the snapshot is actually deleted. :param snapshot: snapshot object """ snapshot.delete() bench_utils.wait_for_delete( snapshot, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval)
def _delete_image(self, image): """Deletes the given image. Returns when the image is actually deleted. :param image: Image object """ image.delete() bench_utils.wait_for_delete( image, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.glance_image_delete_timeout, check_interval=CONF.benchmark.glance_image_delete_poll_interval)
def _delete_stack(self, stack): """Delete given stack. Returns when the stack is actually deleted. :param stack: stack object """ stack.delete() bench_utils.wait_for_delete( stack, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.heat_stack_delete_timeout, check_interval=CONF.benchmark.heat_stack_delete_poll_interval)
def _delete_environment(self, environment): """Delete given environment. Return when the environment is actually deleted. :param environment: Environment instance """ self.clients("murano").environments.delete(environment.id) bench_utils.wait_for_delete( environment, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.delete_environment_timeout, check_interval=CONF.benchmark.delete_environment_check_interval)
def _delete_backup(self, backup): """Delete the given backup. Returns when the backup is actually deleted. :param backup: backup instance """ backup.delete() bench_utils.wait_for_delete( backup, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval)
def _delete_stack(self, stack): """Delete the given stack. Returns when the stack is actually deleted. :param stack: stack object """ stack.delete() bench_utils.wait_for_delete( stack, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.heat_stack_delete_timeout, check_interval=CONF.benchmark.heat_stack_delete_poll_interval)
def _delete_server(self, server): """Deletes the given server. Returns when the server is actually deleted. :param server: Server object """ server.delete() bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF.benchmark.nova_server_delete_poll_interval)
def _delete_volume(self, volume): """Delete the given volume. Returns when the volume is actually deleted. :param volume: volume object """ volume.delete() bench_utils.wait_for_delete( volume, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval)
def _delete_snapshot(self, snapshot): """Delete the given snapshot. Returns when the snapshot is actually deleted. :param snapshot: snapshot object """ snapshot.delete() bench_utils.wait_for_delete( snapshot, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval )
def _delete_volume(self, volume): """Delete the given volume. Returns when the volume is actually deleted. :param volume: volume object """ volume.delete() bench_utils.wait_for_delete( volume, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval )
def _delete_server(self, server): """Deletes the given server. Returns when the server is actually deleted. :param server: Server object """ server.delete() bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF.benchmark.nova_server_delete_poll_interval )
def _delete_environment(self, environment): """Delete given environment. Return when the environment is actually deleted. :param environment: Environment instance """ self.clients("murano").environments.delete(environment.id) bench_utils.wait_for_delete( environment, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.delete_environment_timeout, check_interval=CONF.benchmark.delete_environment_check_interval )
def _delete_backup(self, backup): """Delete the given backup. Returns when the backup is actually deleted. :param backup: backup instance """ backup.delete() bench_utils.wait_for_delete( backup, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.cinder_volume_delete_timeout, check_interval=CONF.benchmark.cinder_volume_delete_poll_interval )
def _wait_for_resources_deletion(self, resources): """Waiter for resources deletion. :param resources: resource or list of resources for deletion verification """ if not resources: return if not isinstance(resources, list): resources = [resources] for resource in resources: bench_utils.wait_for_delete( resource, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.manila_share_delete_timeout, check_interval=( CONF.benchmark.manila_share_delete_poll_interval))
def _delete_environment(self, environment, timeout=180, check_interval=2): """Delete given environment. Return when the environment is actually deleted. :param environment: Environment instance :param timeout: Timeout in seconds after which a TimeoutException will be raised, by default 180 :param check_interval: Interval in seconds between the two consecutive readiness checks, by default 2 """ self.clients("murano").environments.delete(environment.id) bench_utils.wait_for_delete( environment, update_resource=bench_utils.get_from_manager(), timeout=timeout, check_interval=check_interval)
def _delete_environment(self, environment, timeout=180, check_interval=2): """Delete given environment. Return when the environment is actually deleted. :param environment: Environment instance :param timeout: Timeout in seconds after which a TimeoutException will be raised, by default 180 :param check_interval: Interval in seconds between the two consecutive readiness checks, by default 2 """ self.clients("murano").environments.delete(environment.id) bench_utils.wait_for_delete( environment, update_resource=bench_utils.get_from_manager(), timeout=timeout, check_interval=check_interval )
def _delete_server(self, server, force=False): """Delete the given server. Returns when the server is actually deleted. :param server: Server object :param force: If True, force_delete will be used instead of delete. """ atomic_name = ("nova.%sdelete_server") % (force and "force_" or "") with base.AtomicAction(self, atomic_name): if force: server.force_delete() else: server.delete() bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF.benchmark.nova_server_delete_poll_interval)
def _delete_servers(self, servers, force=False): """Delete multiple servers. :param servers: A list of servers to delete :param force: If True, force_delete will be used instead of delete. """ atomic_name = ("nova.%sdelete_servers") % (force and "force_" or "") with base.AtomicAction(self, atomic_name): for server in servers: if force: server.force_delete() else: server.delete() for server in servers: bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF.benchmark. nova_server_delete_poll_interval)
def _delete_server(self, server, force=False): """Delete the given server. Returns when the server is actually deleted. :param server: Server object :param force: If True, force_delete will be used instead of delete. """ atomic_name = ("nova.%sdelete_server") % (force and "force_" or "") with base.AtomicAction(self, atomic_name): if force: server.force_delete() else: server.delete() bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF.benchmark.nova_server_delete_poll_interval )
def _delete_servers(self, servers, force=False): """Delete multiple servers. :param servers: A list of servers to delete :param force: If True, force_delete will be used instead of delete. """ atomic_name = ("nova.%sdelete_servers") % (force and "force_" or "") with base.AtomicAction(self, atomic_name): for server in servers: if force: server.force_delete() else: server.delete() for server in servers: bench_utils.wait_for_delete( server, update_resource=bench_utils.get_from_manager(), timeout=CONF.benchmark.nova_server_delete_timeout, check_interval=CONF. benchmark.nova_server_delete_poll_interval )
def test_wait_for_delete(self): def update_resource(self): raise exceptions.GetResourceNotFound() resource = mock.MagicMock() utils.wait_for_delete(resource, update_resource=update_resource)