Skip to content

Commit

Permalink
orchestra/run.py: remove spawn_asyncresult()
Browse files Browse the repository at this point in the history
Since the function is dead code, there are no calls to it in teuthology
or ceph repository, remove it.

Signed-off-by: Rishabh Dave <[email protected]>
  • Loading branch information
rishabh-d-dave committed Jun 16, 2021
1 parent af41a83 commit c013aa4
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions teuthology/orchestra/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from paramiko import ChannelFile

import gevent
import gevent.event
import socket
import logging
import shutil
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c013aa4

Please sign in to comment.