From c013aa4e223ee52b3fb7eb1c096223a036240c26 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Wed, 16 Jun 2021 09:28:15 +0530 Subject: [PATCH] orchestra/run.py: remove spawn_asyncresult() Since the function is dead code, there are no calls to it in teuthology or ceph repository, remove it. Signed-off-by: Rishabh Dave --- teuthology/orchestra/run.py | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index 3f2be458b5..399927177f 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -7,7 +7,6 @@ from paramiko import ChannelFile import gevent -import gevent.event import socket import logging import shutil @@ -285,32 +284,6 @@ def copy_file_to(src, logger, stream=None, quiet=False): """ copy_to_log(src, logger, capture=stream, quiet=quiet) -def spawn_asyncresult(fn, *args, **kwargs): - """ - Spawn a Greenlet and pass it's results to an AsyncResult. - - This function is useful to shuffle data from a Greenlet to - AsyncResult, which then again is useful because any Greenlets that - raise exceptions will cause tracebacks to be shown on stderr by - gevent, even when ``.link_exception`` has been called. Using an - AsyncResult avoids this. - """ - r = gevent.event.AsyncResult() - - def wrapper(): - """ - Internal wrapper. - """ - try: - value = fn(*args, **kwargs) - except Exception as e: - r.set_exception(e) - else: - r.set(value) - gevent.spawn(wrapper) - - return r - def run( client, args,