From cea9a260a7a4b80542820e1ec4faaeb9df2e283f Mon Sep 17 00:00:00 2001 From: John Spray Date: Tue, 7 Aug 2018 09:48:56 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/mgr_module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index 49d38a95f61d8..3a60dff93351c 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 -- 2.39.5