File pacemaker-crm_ticket-all-tickets.diff of Package pacemaker

commit dfdf37641c0bfc405673b4b324bd7d4304004685
Author: Gao,Yan <ygao@suse.com>
Date:   Sun Mar 25 15:09:25 2012 +0800

    Medium: Tools: crm_ticket - Display the tickets that are referenced in rsc_ticket constraints but have never been granted yet.

diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c
index f90ba23..e822de4 100644
--- a/tools/crm_ticket.c
+++ b/tools/crm_ticket.c
@@ -40,6 +40,8 @@
 #include <crm/pengine/rules.h>
 #include <crm/pengine/status.h>
 
+#include <../pengine/pengine.h>
+
 gboolean do_force = FALSE;
 gboolean BE_QUIET = FALSE;
 const char *ticket_id = NULL;
@@ -653,6 +655,7 @@ main(int argc, char **argv)
 {
     pe_working_set_t data_set;
     xmlNode *cib_xml_copy = NULL;
+    xmlNode *cib_constraints = NULL;
 
     cib_t *cib_conn = NULL;
     enum cib_errors rc = cib_ok;
@@ -783,6 +786,11 @@ main(int argc, char **argv)
 
     cluster_status(&data_set);
 
+    /* For recording the tickets that are referenced in rsc_ticket constraints
+     * but have never been granted yet. */
+    cib_constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, data_set.input);
+    unpack_constraints(cib_constraints, &data_set);
+
     if (ticket_cmd == 'l' || ticket_cmd == 'L' || ticket_cmd == 'w') {
         gboolean raw = FALSE;
         gboolean details = FALSE;
openSUSE Build Service is sponsored by