From: John Spray Date: Tue, 7 Aug 2018 13:48:56 +0000 (-0400) Subject: mgr: cleaner constructor for CommandResult X-Git-Tag: v14.1.0~776^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cea9a260a7a4b80542820e1ec4faaeb9df2e283f;p=ceph.git mgr: cleaner constructor for CommandResult 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 --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 49d38a95f61d..3a60dff93351 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -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