File pacemaker#3362-0001-Low-libcrmcommon-Always-output-request-in-XML-output.patch of Package pacemaker.34780

From 13ee605d9e147d1979a8e9d5de79486c1df6dff0 Mon Sep 17 00:00:00 2001
From: Chris Lumens <clumens@redhat.com>
Date: Tue, 13 Feb 2024 14:51:43 -0500
Subject: [PATCH] Low: libcrmcommon: Always output request= in XML output.

Previously, we were only doing this if there was a command line
involved.  However, for public API use, there won't be a command line.
This is a problem because the XML schema requires a request to be
present.  So, just add request="libpacemaker" in those cases.
---
 lib/common/output_xml.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: pacemaker-2.1.2+20211124.ada5c3b36/lib/common/output_xml.c
===================================================================
--- pacemaker-2.1.2+20211124.ada5c3b36.orig/lib/common/output_xml.c
+++ pacemaker-2.1.2+20211124.ada5c3b36/lib/common/output_xml.c
@@ -116,10 +116,8 @@ xml_init(pcmk__output_t *out) {
     } else {
         priv->root = create_xml_node(NULL, "pacemaker-result");
         crm_xml_add(priv->root, "api-version", PCMK__API_VERSION);
-
-        if (out->request != NULL) {
-            crm_xml_add(priv->root, "request", out->request);
-        }
+        crm_xml_add(priv->root, "request",
+                    out->request? out->request : "libpacemaker");
     }
 
     priv->parent_q = g_queue_new();
openSUSE Build Service is sponsored by