From 6c3e54530658051fc672c5938f2f200a05948060 Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Tue, 9 Aug 2022 14:07:16 -0700 Subject: [PATCH] Management framework: fix early return condition for get-id-value This erroneously used connectedness of instances, not presence of a deployed cluster. Without a deployment, there's no point in trying to retrieve global ID values. --- scripts/policy/frameworks/management/controller/main.zeek | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/policy/frameworks/management/controller/main.zeek b/scripts/policy/frameworks/management/controller/main.zeek index be3052af19..8a757cb19e 100644 --- a/scripts/policy/frameworks/management/controller/main.zeek +++ b/scripts/policy/frameworks/management/controller/main.zeek @@ -1174,11 +1174,11 @@ event Management::Controller::API::get_id_value_request(reqid: string, id: strin local res: Management::Result; - # Special case: if we have no instances, respond right away. - if ( |g_instances_known| == 0 ) + # Special case: if we have no deployed cluster, respond right away. + if ( |g_instances| == 0 ) { Management::Log::info(fmt("tx Management::Controller::API::get_id_value_response %s", reqid)); - res = Management::Result($reqid=reqid, $success=F, $error="no instances connected"); + res = Management::Result($reqid=reqid, $success=F, $error="no cluster deployed"); Broker::publish(Management::Controller::topic, Management::Controller::API::get_id_value_response, reqid, vector(res));