]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_argparse.py: argument 'target' change to func 21659/head
authoryangdeliu <yangdeliu@szsandstone.com>
Sat, 28 Apr 2018 09:56:06 +0000 (17:56 +0800)
committeryangdeliu <yangdeliu@szsandstone.com>
Sat, 28 Apr 2018 09:56:06 +0000 (17:56 +0800)
'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 <yangdeliu@szsandstone.com>
src/pybind/ceph_argparse.py

index 5e10447df3ccdd2b6370e123a09b9eb855766077..8bac68cc57ce8004259086a4148b429efa36e180 100644 (file)
@@ -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