From 4f5a65a1ef31c726d6b20a70fdeb07548440756a Mon Sep 17 00:00:00 2001 From: Stephane Thiell Date: Fri, 8 Aug 2025 14:24:57 -0700 Subject: [PATCH] Clush: handle _ev_routing() reroute events Display gateway reroute events. Can be quieted with -q. --- lib/ClusterShell/CLI/Clush.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ClusterShell/CLI/Clush.py b/lib/ClusterShell/CLI/Clush.py index 9772f484..0bee34af 100755 --- a/lib/ClusterShell/CLI/Clush.py +++ b/lib/ClusterShell/CLI/Clush.py @@ -134,6 +134,14 @@ def ev_written(self, worker, node, sname, size): if self._runtimer: self._runtimer.eh.bytes_written += size + def _ev_routing(self, worker, arg): + prefix = "clush: " + self._display.vprint_err(VERB_DEBUG, prefix + "_ev_routing: %s" % arg) + if "reroute" in arg.get("event", ""): + info_fmt = "rerouting commands for {targets} due to the failure " \ + "of gateway {gateway}" + self._display.vprint_err(VERB_STD, prefix + info_fmt.format(**arg)) + class DirectOutputHandler(OutputHandler): """Direct output event handler class."""