From fb733eb664fd5a9d1e37bc3721032c9741f83307 Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Tue, 9 Aug 2022 15:12:39 -0700 Subject: [PATCH] Management framework: log node set in dispatch requests cleanly Converting to a (sorted) vector both renders the empty set cleanly (without whitespace) and ensures consistent ordering. --- scripts/policy/frameworks/management/agent/main.zeek | 3 ++- scripts/policy/frameworks/management/node/main.zeek | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/policy/frameworks/management/agent/main.zeek b/scripts/policy/frameworks/management/agent/main.zeek index b3e2ec541a..586a2be4fc 100644 --- a/scripts/policy/frameworks/management/agent/main.zeek +++ b/scripts/policy/frameworks/management/agent/main.zeek @@ -755,7 +755,8 @@ event Management::Node::API::node_dispatch_response(reqid: string, result: Manag event Management::Agent::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string]) { - Management::Log::info(fmt("rx Management::Agent::API::node_dispatch_request %s %s %s", reqid, action, nodes)); + Management::Log::info(fmt("rx Management::Agent::API::node_dispatch_request %s %s %s", + reqid, action, Management::Util::set_to_vector(nodes))); local node: string; local cluster_nodes: set[string]; diff --git a/scripts/policy/frameworks/management/node/main.zeek b/scripts/policy/frameworks/management/node/main.zeek index 00236c17c5..20d9ea70e9 100644 --- a/scripts/policy/frameworks/management/node/main.zeek +++ b/scripts/policy/frameworks/management/node/main.zeek @@ -57,7 +57,8 @@ global g_dispatch_table: table[string] of DispatchCallback = { event Management::Node::API::node_dispatch_request(reqid: string, action: vector of string, nodes: set[string]) { - Management::Log::info(fmt("rx Management::Node::API::node_dispatch_request %s %s %s", reqid, action, nodes)); + Management::Log::info(fmt("rx Management::Node::API::node_dispatch_request %s %s %s", + reqid, action, Management::Util::set_to_vector(nodes))); if ( |nodes| > 0 && Cluster::node !in nodes ) {