File pacemaker#3409-0005-Fix-tools-honor-rules-when-getting-utilization-attri.patch of Package pacemaker.34780
From ccd09841c87dda32e83d65a661f9184809db824e Mon Sep 17 00:00:00 2001
From: Ken Gaillot <kgaillot@redhat.com>
Date: Thu, 14 Mar 2024 17:50:25 -0500
Subject: [PATCH 5/7] Fix: tools: honor rules when getting utilization
attributes with crm_resource
---
tools/crm_resource.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: pacemaker-2.1.5+20221208.a3f44794f/tools/crm_resource.c
===================================================================
--- pacemaker-2.1.5+20221208.a3f44794f.orig/tools/crm_resource.c
+++ pacemaker-2.1.5+20221208.a3f44794f/tools/crm_resource.c
@@ -2039,9 +2039,14 @@ main(int argc, char **argv)
get_meta_attributes(params, rsc, NULL, data_set);
} else {
+ pe_rule_eval_data_t rule_data = {
+ .now = data_set->now,
+ };
+
params = pcmk__strkey_table(free, free);
- pe__unpack_dataset_nvpairs(rsc->xml, XML_TAG_UTILIZATION, NULL, params,
- NULL, FALSE, data_set);
+ pe__unpack_dataset_nvpairs(rsc->xml, XML_TAG_UTILIZATION,
+ &rule_data, params, NULL, FALSE,
+ data_set);
}
rc = out->message(out, "attribute-list", rsc, options.prop_name, params);