From 6914bfb0b8e530393475cb7d1ff7c96977c3f94a Mon Sep 17 00:00:00 2001 From: yangdeliu Date: Sat, 28 Apr 2018 17:56:06 +0800 Subject: [PATCH] pybind/ceph_argparse.py: argument 'target' change to func 'run_in_thread' first argument named 'target'. It is confusing with cluster.mon_command last argument 'target=None'. So change 'run_in_thread' and RadosThread 'target' to 'func' Signed-off-by: yangdeliu --- src/pybind/ceph_argparse.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index 5e10447df3cc..8bac68cc57ce 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -1172,16 +1172,16 @@ def find_cmd_target(childargs): class RadosThread(threading.Thread): - def __init__(self, target, *args, **kwargs): + def __init__(self, func, *args, **kwargs): self.args = args self.kwargs = kwargs - self.target = target + self.func = func self.exception = None threading.Thread.__init__(self) def run(self): try: - self.retval = self.target(*self.args, **self.kwargs) + self.retval = self.func(*self.args, **self.kwargs) except Exception as e: self.exception = e @@ -1190,11 +1190,11 @@ class RadosThread(threading.Thread): POLL_TIME_INCR = 0.5 -def run_in_thread(target, *args, **kwargs): +def run_in_thread(func, *args, **kwargs): interrupt = False timeout = kwargs.pop('timeout', 0) countdown = timeout - t = RadosThread(target, *args, **kwargs) + t = RadosThread(func, *args, **kwargs) # allow the main thread to exit (presumably, avoid a join() on this # subthread) before this thread terminates. This allows SIGINT -- 2.47.3