]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: cleaner constructor for CommandResult
authorJohn Spray <john.spray@redhat.com>
Tue, 7 Aug 2018 13:48:56 +0000 (09:48 -0400)
committerSage Weil <sage@redhat.com>
Tue, 27 Nov 2018 03:43:43 +0000 (21:43 -0600)
This is just to reduce the visual noise of all the
CommandResult("").  Nothing really uses the optional
tag part, but it's conceivably useful so let's not
rip it out just yet.

Signed-off-by: John Spray <john.spray@redhat.com>
src/pybind/mgr/mgr_module.py

index 49d38a95f61d805c97c22432ebc72f658fe96e78..3a60dff93351c5a6b3ecff959be9c4c3b67f1470 100644 (file)
@@ -87,7 +87,7 @@ class CommandResult(object):
     """
     Use with MgrModule.send_command
     """
-    def __init__(self, tag):
+    def __init__(self, tag=None):
         self.ev = threading.Event()
         self.outs = ""
         self.outb = ""
@@ -95,7 +95,7 @@ class CommandResult(object):
 
         # This is just a convenience for notifications from
         # C++ land, to avoid passing addresses around in messages.
-        self.tag = tag
+        self.tag = tag if tag else ""
 
     def complete(self, r, outb, outs):
         self.r = r