Accepting request 115601 from network:ha-clustering:Factory
Update Pacemaker ticket support OBS-URL: https://build.opensuse.org/request/show/115601 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/pacemaker?expand=0&rev=46
This commit is contained in:
commit
6ae7956a6e
76
pacemaker-coverity-defects.diff
Normal file
76
pacemaker-coverity-defects.diff
Normal file
@ -0,0 +1,76 @@
|
||||
commit 54001929bb3faf05d25176cdc84097ec5fa0979f
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Mon Mar 26 12:22:32 2012 +0800
|
||||
|
||||
High: Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects
|
||||
|
||||
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
|
||||
index 4a8a20f..3485f78 100644
|
||||
--- a/lib/pengine/unpack.c
|
||||
+++ b/lib/pengine/unpack.c
|
||||
@@ -548,10 +548,12 @@ get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data)
|
||||
}
|
||||
|
||||
if (ticket_id == NULL || strlen(ticket_id) == 0) {
|
||||
+ crm_free(state_key);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state_key == NULL || strlen(state_key) == 0) {
|
||||
+ crm_free(state_key);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -559,6 +561,7 @@ get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data)
|
||||
if (ticket == NULL) {
|
||||
ticket = ticket_new(ticket_id, data_set);
|
||||
if (ticket == NULL) {
|
||||
+ crm_free(state_key);
|
||||
return;
|
||||
}
|
||||
}
|
||||
diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c
|
||||
index e822de4..aec9e98 100644
|
||||
--- a/tools/crm_ticket.c
|
||||
+++ b/tools/crm_ticket.c
|
||||
@@ -308,7 +308,7 @@ find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *tic
|
||||
|
||||
if (attr_name) {
|
||||
const char *attr_prefix = NULL;
|
||||
- const char *long_key = NULL;
|
||||
+ char *long_key = NULL;
|
||||
|
||||
if (crm_str_eq(attr_name, "granted", TRUE)) {
|
||||
attr_prefix = "granted-ticket";
|
||||
@@ -321,6 +321,8 @@ find_ticket_state_attr_legacy(cib_t * the_cib, const char *attr, const char *tic
|
||||
offset += snprintf(xpath_string + offset, xpath_max - offset, " and ");
|
||||
}
|
||||
offset += snprintf(xpath_string + offset, xpath_max - offset, "@name=\"%s\"", long_key);
|
||||
+
|
||||
+ crm_free(long_key);
|
||||
}
|
||||
offset += snprintf(xpath_string + offset, xpath_max - offset, "]");
|
||||
|
||||
@@ -763,6 +765,13 @@ main(int argc, char **argv)
|
||||
set_working_set_defaults(&data_set);
|
||||
|
||||
cib_conn = cib_new();
|
||||
+ if (cib_conn == NULL) {
|
||||
+ rc = cib_connection;
|
||||
+ CMD_ERR("Error initiating the connection to the CIB service: %s\n",
|
||||
+ cib_error2string(rc));
|
||||
+ return rc;
|
||||
+ }
|
||||
+
|
||||
rc = cib_conn->cmds->signon(cib_conn, crm_system_name, cib_command);
|
||||
if (rc != cib_ok) {
|
||||
CMD_ERR("Error signing on to the CIB service: %s\n", cib_error2string(rc));
|
||||
@@ -933,7 +942,7 @@ main(int argc, char **argv)
|
||||
|
||||
ticket = find_ticket(ticket_id, &data_set);
|
||||
if (ticket == NULL) {
|
||||
- return cib_NOTEXISTS;
|
||||
+ rc = cib_NOTEXISTS;
|
||||
goto bail;
|
||||
}
|
||||
|
109
pacemaker-crm_mon-tickets.diff
Normal file
109
pacemaker-crm_mon-tickets.diff
Normal file
@ -0,0 +1,109 @@
|
||||
commit 147890c8f9200960b3212a4a5acca4240f20451d
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Sun Mar 25 16:27:38 2012 +0800
|
||||
|
||||
High: Tools: crm_mon - Support to display tickets (based on Yuusuke Iida's work)
|
||||
|
||||
diff --git a/tools/Makefile.am b/tools/Makefile.am
|
||||
index 2c2192c..9922bfe 100644
|
||||
--- a/tools/Makefile.am
|
||||
+++ b/tools/Makefile.am
|
||||
@@ -95,6 +95,7 @@ crm_diff_LDADD = $(COMMONLIBS)
|
||||
|
||||
crm_mon_SOURCES = crm_mon.c
|
||||
crm_mon_LDADD = $(top_builddir)/lib/pengine/libpe_status.la \
|
||||
+ $(top_builddir)/pengine/libpengine.la \
|
||||
$(COMMONLIBS) $(SNMPLIBS) $(ESMTPLIBS) -llrm
|
||||
|
||||
# Arguments could be made that this should live in crm/pengine
|
||||
diff --git a/tools/crm_mon.c b/tools/crm_mon.c
|
||||
index b71e574..3f6ad37 100644
|
||||
--- a/tools/crm_mon.c
|
||||
+++ b/tools/crm_mon.c
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <crm/cib.h>
|
||||
#include <crm/pengine/status.h>
|
||||
#include <../lib/pengine/unpack.h>
|
||||
+#include <../pengine/pengine.h>
|
||||
|
||||
/* GMainLoop *mainloop = NULL; */
|
||||
|
||||
@@ -88,6 +89,7 @@ gboolean print_timing = FALSE;
|
||||
gboolean print_nodes_attr = FALSE;
|
||||
gboolean print_last_updated = TRUE;
|
||||
gboolean print_last_change = TRUE;
|
||||
+gboolean print_tickets = FALSE;
|
||||
|
||||
#define FILTER_STR {"shutdown", "terminate", "standby", "fail-count", \
|
||||
"last-failure", "probe_complete", "#id", "#uname", \
|
||||
@@ -300,7 +302,8 @@ static struct crm_option long_options[] = {
|
||||
{"failcounts", 0, 0, 'f', "\tDisplay resource fail counts"},
|
||||
{"operations", 0, 0, 'o', "\tDisplay resource operation history" },
|
||||
{"timing-details", 0, 0, 't', "\tDisplay resource operation history with timing details" },
|
||||
- {"show-node-attributes", 0, 0, 'A', "Display node attributes\n" },
|
||||
+ {"show-node-attributes", 0, 0, 'A', "Display node attributes" },
|
||||
+ {"tickets", 0, 0, 'c', "\t\tDisplay cluster tickets"},
|
||||
|
||||
{"-spacer-", 1, 0, '-', "\nAdditional Options:"},
|
||||
{"interval", 1, 0, 'i', "\tUpdate frequency in seconds" },
|
||||
@@ -400,6 +403,9 @@ main(int argc, char **argv)
|
||||
case 'A':
|
||||
print_nodes_attr = TRUE;
|
||||
break;
|
||||
+ case 'c':
|
||||
+ print_tickets = TRUE;
|
||||
+ break;
|
||||
case 'p':
|
||||
crm_free(pid_file);
|
||||
pid_file = crm_strdup(optarg);
|
||||
@@ -948,6 +954,38 @@ print_node_summary(pe_working_set_t * data_set, gboolean operations)
|
||||
}
|
||||
}
|
||||
|
||||
+static void
|
||||
+print_ticket(gpointer name, gpointer value, gpointer data)
|
||||
+{
|
||||
+ ticket_t *ticket = (ticket_t *) value;
|
||||
+
|
||||
+ print_as(" %s\t%s%10s", ticket->id,
|
||||
+ ticket->granted ? "granted":"revoked",
|
||||
+ ticket->standby ? " [standby]":"");
|
||||
+ if (ticket->last_granted > -1) {
|
||||
+ print_as(" last-granted=");
|
||||
+ print_date(ticket->last_granted);
|
||||
+ }
|
||||
+ print_as("\n");
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
+static void
|
||||
+print_cluster_tickets(pe_working_set_t * data_set)
|
||||
+{
|
||||
+ xmlNode *cib_constraints = get_object_root(XML_CIB_TAG_CONSTRAINTS, data_set->input);
|
||||
+
|
||||
+ /* For recording the tickets that are referenced in rsc_ticket constraints
|
||||
+ * but have never been granted yet. */
|
||||
+ unpack_constraints(cib_constraints, data_set);
|
||||
+
|
||||
+ print_as("\nTickets:\n");
|
||||
+ g_hash_table_foreach(data_set->tickets, print_ticket, NULL);
|
||||
+
|
||||
+ return;
|
||||
+}
|
||||
+
|
||||
static char *
|
||||
add_list_element(char *list, const char *value)
|
||||
{
|
||||
@@ -1209,6 +1247,11 @@ print_status(pe_working_set_t * data_set)
|
||||
print_as("): %s\n", execra_code2string(val));
|
||||
}
|
||||
}
|
||||
+
|
||||
+ if (print_tickets) {
|
||||
+ print_cluster_tickets(data_set);
|
||||
+ }
|
||||
+
|
||||
#if CURSES_ENABLED
|
||||
if (as_console) {
|
||||
refresh();
|
206
pacemaker-crm_simulate-ticket-state.diff
Normal file
206
pacemaker-crm_simulate-ticket-state.diff
Normal file
@ -0,0 +1,206 @@
|
||||
commit 1631d9396f69ac54f0b4f84a5f7ab6d016026c87
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Sun Mar 25 22:34:05 2012 +0800
|
||||
|
||||
High: Tools: crm_simulate - Support to grant/revoke/standby/activate tickets from the new ticket state section
|
||||
|
||||
diff --git a/tools/crm_inject.c b/tools/crm_inject.c
|
||||
index 9024e31..c068613 100644
|
||||
--- a/tools/crm_inject.c
|
||||
+++ b/tools/crm_inject.c
|
||||
@@ -755,10 +755,91 @@ create_dotfile(pe_working_set_t * data_set, const char *dot_file, gboolean all_a
|
||||
}
|
||||
}
|
||||
|
||||
+static int
|
||||
+find_ticket_state(cib_t * the_cib, const char * ticket_id, xmlNode ** ticket_state_xml)
|
||||
+{
|
||||
+ int offset = 0;
|
||||
+ static int xpath_max = 1024;
|
||||
+ enum cib_errors rc = cib_ok;
|
||||
+ xmlNode *xml_search = NULL;
|
||||
+
|
||||
+ char *xpath_string = NULL;
|
||||
+
|
||||
+ CRM_ASSERT(ticket_state_xml != NULL);
|
||||
+ *ticket_state_xml = NULL;
|
||||
+
|
||||
+ crm_malloc0(xpath_string, xpath_max);
|
||||
+ offset +=
|
||||
+ snprintf(xpath_string + offset, xpath_max - offset, "%s", "/cib/status/tickets");
|
||||
+
|
||||
+ if (ticket_id) {
|
||||
+ offset += snprintf(xpath_string + offset, xpath_max - offset, "/%s[@id=\"%s\"]",
|
||||
+ XML_CIB_TAG_TICKET_STATE, ticket_id);
|
||||
+ }
|
||||
+
|
||||
+ rc = the_cib->cmds->query(the_cib, xpath_string, &xml_search,
|
||||
+ cib_sync_call | cib_scope_local | cib_xpath);
|
||||
+
|
||||
+ if (rc != cib_ok) {
|
||||
+ goto bail;
|
||||
+ }
|
||||
+
|
||||
+ crm_log_xml_debug(xml_search, "Match");
|
||||
+ if (xml_has_children(xml_search)) {
|
||||
+ if (ticket_id) {
|
||||
+ fprintf(stdout, "Multiple ticket_states match ticket_id=%s\n", ticket_id);
|
||||
+ }
|
||||
+ *ticket_state_xml = xml_search;
|
||||
+ } else {
|
||||
+ *ticket_state_xml = xml_search;
|
||||
+ }
|
||||
+
|
||||
+ bail:
|
||||
+ crm_free(xpath_string);
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
+static int
|
||||
+set_ticket_state_attr(const char *ticket_id, const char *attr_name,
|
||||
+ const char *attr_value, cib_t * cib, int cib_options)
|
||||
+{
|
||||
+ enum cib_errors rc = cib_ok;
|
||||
+ xmlNode *xml_top = NULL;
|
||||
+ xmlNode *ticket_state_xml = NULL;
|
||||
+
|
||||
+ rc = find_ticket_state(cib, ticket_id, &ticket_state_xml);
|
||||
+ if (rc == cib_ok) {
|
||||
+ crm_debug("Found a match state for ticket: id=%s", ticket_id);
|
||||
+ xml_top = ticket_state_xml;
|
||||
+
|
||||
+ } else if (rc != cib_NOTEXISTS) {
|
||||
+ return rc;
|
||||
+
|
||||
+ } else {
|
||||
+ xmlNode *xml_obj = NULL;
|
||||
+
|
||||
+ xml_top = create_xml_node(NULL, XML_CIB_TAG_STATUS);
|
||||
+ xml_obj = create_xml_node(xml_top, XML_CIB_TAG_TICKETS);
|
||||
+ ticket_state_xml = create_xml_node(xml_obj, XML_CIB_TAG_TICKET_STATE);
|
||||
+ crm_xml_add(ticket_state_xml, XML_ATTR_ID, ticket_id);
|
||||
+ }
|
||||
+
|
||||
+ crm_xml_add(ticket_state_xml, attr_name, attr_value);
|
||||
+
|
||||
+ crm_log_xml_debug(xml_top, "Update");
|
||||
+
|
||||
+ rc = cib->cmds->modify(cib, XML_CIB_TAG_STATUS, xml_top, cib_options);
|
||||
+
|
||||
+ free_xml(xml_top);
|
||||
+
|
||||
+ return rc;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
modify_configuration(pe_working_set_t * data_set,
|
||||
const char *quorum, GListPtr node_up, GListPtr node_down, GListPtr node_fail,
|
||||
- GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke)
|
||||
+ GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke,
|
||||
+ GListPtr ticket_standby, GListPtr ticket_activate)
|
||||
{
|
||||
int rc = cib_ok;
|
||||
GListPtr gIter = NULL;
|
||||
@@ -818,29 +899,41 @@ modify_configuration(pe_working_set_t * data_set,
|
||||
}
|
||||
|
||||
for (gIter = ticket_grant; gIter != NULL; gIter = gIter->next) {
|
||||
- char *ticket = (char *)gIter->data;
|
||||
- char *attr_name = crm_concat("granted-ticket", ticket, '-');
|
||||
-
|
||||
- quiet_log(" + Granting ticket %s\n", ticket);
|
||||
- rc = update_attr(global_cib, cib_sync_call | cib_scope_local,
|
||||
- XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL,
|
||||
- attr_name, "true", TRUE);
|
||||
+ char *ticket_id = (char *)gIter->data;
|
||||
|
||||
- crm_free(attr_name);
|
||||
+ quiet_log(" + Granting ticket %s\n", ticket_id);
|
||||
+ rc = set_ticket_state_attr(ticket_id, "granted", "true",
|
||||
+ global_cib, cib_sync_call | cib_scope_local);
|
||||
|
||||
CRM_ASSERT(rc == cib_ok);
|
||||
}
|
||||
|
||||
for (gIter = ticket_revoke; gIter != NULL; gIter = gIter->next) {
|
||||
- char *ticket = (char *)gIter->data;
|
||||
- char *attr_name = crm_concat("granted-ticket", ticket, '-');
|
||||
+ char *ticket_id = (char *)gIter->data;
|
||||
+
|
||||
+ quiet_log(" + Revoking ticket %s\n", ticket_id);
|
||||
+ rc = set_ticket_state_attr(ticket_id, "granted", "false",
|
||||
+ global_cib, cib_sync_call | cib_scope_local);
|
||||
|
||||
- quiet_log(" + Revoking ticket %s\n", ticket);
|
||||
- rc = update_attr(global_cib, cib_sync_call | cib_scope_local,
|
||||
- XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL,
|
||||
- attr_name, "false", TRUE);
|
||||
+ CRM_ASSERT(rc == cib_ok);
|
||||
+ }
|
||||
+
|
||||
+ for (gIter = ticket_standby; gIter != NULL; gIter = gIter->next) {
|
||||
+ char *ticket_id = (char *)gIter->data;
|
||||
+
|
||||
+ quiet_log(" + Making ticket %s standby\n", ticket_id);
|
||||
+ rc = set_ticket_state_attr(ticket_id, "standby", "true",
|
||||
+ global_cib, cib_sync_call | cib_scope_local);
|
||||
+
|
||||
+ CRM_ASSERT(rc == cib_ok);
|
||||
+ }
|
||||
+
|
||||
+ for (gIter = ticket_activate; gIter != NULL; gIter = gIter->next) {
|
||||
+ char *ticket_id = (char *)gIter->data;
|
||||
|
||||
- crm_free(attr_name);
|
||||
+ quiet_log(" + Activating ticket %s\n", ticket_id);
|
||||
+ rc = set_ticket_state_attr(ticket_id, "standby", "false",
|
||||
+ global_cib, cib_sync_call | cib_scope_local);
|
||||
|
||||
CRM_ASSERT(rc == cib_ok);
|
||||
}
|
||||
@@ -999,8 +1092,10 @@ static struct crm_option long_options[] = {
|
||||
{"op-fail", 1, 0, 'F', "\t$rsc_$task_$interval@$node=$rc - Fail the specified task while running the simulation"},
|
||||
{"set-datetime", 1, 0, 't', "Set date/time"},
|
||||
{"quorum", 1, 0, 'q', "\tSpecify a value for quorum"},
|
||||
- {"ticket-grant", 1, 0, 'g', "Grant a ticket"},
|
||||
- {"ticket-revoke",1, 0, 'r', "Revoke a ticket"},
|
||||
+ {"ticket-grant", 1, 0, 'g', "Grant a ticket"},
|
||||
+ {"ticket-revoke", 1, 0, 'r', "Revoke a ticket"},
|
||||
+ {"ticket-standby", 1, 0, 'b', "Make a ticket standby"},
|
||||
+ {"ticket-activate", 1, 0, 'e', "Activate a ticket"},
|
||||
|
||||
{"-spacer-", 0, 0, '-', "\nOutput Options:"},
|
||||
|
||||
@@ -1122,6 +1217,8 @@ main(int argc, char **argv)
|
||||
GListPtr op_inject = NULL;
|
||||
GListPtr ticket_grant = NULL;
|
||||
GListPtr ticket_revoke = NULL;
|
||||
+ GListPtr ticket_standby = NULL;
|
||||
+ GListPtr ticket_activate = NULL;
|
||||
|
||||
xmlNode *input = NULL;
|
||||
|
||||
@@ -1203,6 +1300,14 @@ main(int argc, char **argv)
|
||||
modified++;
|
||||
ticket_revoke = g_list_append(ticket_revoke, optarg);
|
||||
break;
|
||||
+ case 'b':
|
||||
+ modified++;
|
||||
+ ticket_standby = g_list_append(ticket_standby, optarg);
|
||||
+ break;
|
||||
+ case 'e':
|
||||
+ modified++;
|
||||
+ ticket_activate = g_list_append(ticket_activate, optarg);
|
||||
+ break;
|
||||
case 'a':
|
||||
all_actions = TRUE;
|
||||
break;
|
||||
@@ -1290,7 +1395,7 @@ main(int argc, char **argv)
|
||||
if (modified) {
|
||||
quiet_log("Performing requested modifications\n");
|
||||
modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject,
|
||||
- ticket_grant, ticket_revoke);
|
||||
+ ticket_grant, ticket_revoke, ticket_standby, ticket_activate);
|
||||
|
||||
rc = global_cib->cmds->query(global_cib, NULL, &input, cib_sync_call);
|
||||
if (rc != cib_ok) {
|
39
pacemaker-crm_ticket-all-tickets.diff
Normal file
39
pacemaker-crm_ticket-all-tickets.diff
Normal file
@ -0,0 +1,39 @@
|
||||
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;
|
143
pacemaker-crm_ticket-force.diff
Normal file
143
pacemaker-crm_ticket-force.diff
Normal file
@ -0,0 +1,143 @@
|
||||
commit e0733a32d39bf673e0ef886dacfbe452f0110967
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Wed Mar 14 20:41:34 2012 +0800
|
||||
|
||||
Medium: Tools: crm_ticket - Granting/revoking tickets need user to confirm unless "--force" option is used
|
||||
|
||||
diff --git a/tools/crm_ticket b/tools/crm_ticket
|
||||
index 27c6fd2..640a541 100755
|
||||
--- a/tools/crm_ticket
|
||||
+++ b/tools/crm_ticket
|
||||
@@ -2,10 +2,12 @@
|
||||
|
||||
options=""
|
||||
ticket=""
|
||||
-granted=""
|
||||
+update_value=""
|
||||
last_granted=""
|
||||
+delete_attr="false"
|
||||
+force="false"
|
||||
|
||||
-TEMP=`getopt -o DGQVThU:v:i:t: --long help,version,ticket:,attr-value:,delete-attr,get-value,attr-id:,quiet,time \
|
||||
+TEMP=`getopt -o DGQVThfv:i:t: --long help,version,ticket:,attr-value:,delete-attr,get-value,attr-id:,force,quiet,time \
|
||||
-n 'crm_ticket' -- "$@"`
|
||||
|
||||
if [ $? != 0 ] ; then echo "crm_ticket - A convenience wrapper for crm_attribute"; echo ""; crm_attribute -?; exit 1 ; fi
|
||||
@@ -13,13 +15,39 @@ if [ $? != 0 ] ; then echo "crm_ticket - A convenience wrapper for crm_attribute
|
||||
# Note the quotes around `$TEMP': they are essential!
|
||||
eval set -- "$TEMP"
|
||||
|
||||
+confirm() {
|
||||
+ action=$1
|
||||
+ ticket=$2
|
||||
+
|
||||
+ if [ X$action = X"grant" ]; then
|
||||
+ warning="The crm_ticket command cannot help you verify if '$ticket' is already granted elsewhere."
|
||||
+ word="to"
|
||||
+ else
|
||||
+ warning="Revoking '$ticket' will trigger the specified 'loss-policy' relating to '$ticket'."
|
||||
+ word="from"
|
||||
+ fi
|
||||
+
|
||||
+ while :; do
|
||||
+ printf "$warning\nAre you sure you want to $action '$ticket' $word this site? (y/n)"
|
||||
+ read ans
|
||||
+ if echo $ans | grep -iqs '^[yn]'; then
|
||||
+ echo $ans | grep -iqs '^y'
|
||||
+ return $?
|
||||
+ else
|
||||
+ echo Please answer with y or n
|
||||
+ fi
|
||||
+ done
|
||||
+}
|
||||
+
|
||||
while true ; do
|
||||
case "$1" in
|
||||
- -v|--attr-value) options="$options $1 $2"; granted=$2; shift; shift;;
|
||||
+ -v|--attr-value) options="$options $1 $2"; update_value=$2; shift; shift;;
|
||||
-i|--attr-id) options="$options $1 $2"; shift; shift;;
|
||||
- -Q|--quiet|-D|--delete-attr|-G|--get-value|-V) options="$options $1"; shift;;
|
||||
+ -D|--delete-attr) options="$options $1"; delete_attr="true"; shift;;
|
||||
+ -Q|--quiet|-G|--get-value|-V) options="$options $1"; shift;;
|
||||
-t|--ticket-id) ticket=$2; shift; shift;;
|
||||
-T|--time) last_granted="time"; shift;;
|
||||
+ -f|--force) force="true"; shift;;
|
||||
--version) crm_attribute --version; exit 0;;
|
||||
-h|--help)
|
||||
echo "crm_ticket - A convenience wrapper for crm_attribute";
|
||||
@@ -43,6 +71,7 @@ while true ; do
|
||||
echo ""
|
||||
echo "Additional Options:"
|
||||
echo " -i, --id=value (Advanced) The ID used to identify the attribute"
|
||||
+ echo " -f, --force (Advanced) Force the action to be performed"
|
||||
exit 0;;
|
||||
--) shift ; break ;;
|
||||
*) echo "Unknown option: $1. See --help for details." exit 1;;
|
||||
@@ -58,8 +87,12 @@ else
|
||||
options="$options -n granted-ticket-$ticket"
|
||||
fi
|
||||
|
||||
-case "$granted" in
|
||||
+case "$update_value" in
|
||||
true|yes|1)
|
||||
+ if [ X$force != X"true" ]; then
|
||||
+ confirm "grant" $ticket || exit 1
|
||||
+ fi
|
||||
+
|
||||
crm_attribute $options -t tickets >/dev/null 2>&1
|
||||
rc=$?
|
||||
if [ $rc = 0 ]; then
|
||||
@@ -73,8 +106,17 @@ case "$granted" in
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
- crm_attribute $options -t tickets -d false
|
||||
- rc=$?
|
||||
- exit $rc
|
||||
+ if [ X$update_value != X -o X$delete_attr = X"true" ]; then
|
||||
+ if [ X$force != X"true" ]; then
|
||||
+ confirm "revoke" $ticket || exit 1
|
||||
+ fi
|
||||
+ crm_attribute $options -t tickets >/dev/null 2>&1
|
||||
+ rc=$?
|
||||
+ exit $rc
|
||||
+ else
|
||||
+ crm_attribute $options -t tickets -d false
|
||||
+ rc=$?
|
||||
+ exit $rc
|
||||
+ fi
|
||||
;;
|
||||
esac
|
||||
diff --git a/tools/regression.exp b/tools/regression.exp
|
||||
index d277c9d..9c672fb 100755
|
||||
--- a/tools/regression.exp
|
||||
+++ b/tools/regression.exp
|
||||
@@ -926,8 +926,6 @@ scope=tickets name=granted-ticket-ticketA value=false
|
||||
</status>
|
||||
</cib>
|
||||
* Passed: crm_ticket - Query granted-ticket value
|
||||
-Deleted tickets option: id=status-tickets-granted-ticket-ticketA name=granted-ticket-ticketA
|
||||
-
|
||||
<cib epoch="18" num_updates="3" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
<crm_config>
|
||||
diff --git a/tools/regression.sh b/tools/regression.sh
|
||||
index 3fc9fb1..a6893dc 100755
|
||||
--- a/tools/regression.sh
|
||||
+++ b/tools/regression.sh
|
||||
@@ -173,13 +173,13 @@ function test_tools() {
|
||||
crm_ticket -t ticketA -G
|
||||
assert $? 0 crm_ticket "Default granted-ticket value"
|
||||
|
||||
- crm_ticket -t ticketA -v false
|
||||
+ crm_ticket -t ticketA -v false --force
|
||||
assert $? 0 crm_ticket "Set granted-ticket value"
|
||||
|
||||
crm_ticket -t ticketA -G
|
||||
assert $? 0 crm_ticket "Query granted-ticket value"
|
||||
|
||||
- crm_ticket -t ticketA -D
|
||||
+ crm_ticket -t ticketA -D --force
|
||||
assert $? 0 crm_ticket "Delete granted-ticket value"
|
||||
}
|
||||
|
238
pacemaker-crm_ticket-tests-standby.diff
Normal file
238
pacemaker-crm_ticket-tests-standby.diff
Normal file
@ -0,0 +1,238 @@
|
||||
commit 0f60f521e85fac6f185f6f5fb71163f7a3772e2b
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Sat Mar 24 09:40:00 2012 +0800
|
||||
|
||||
Low: Tools: Add CLI regression tests for ticket standby state
|
||||
|
||||
diff --git a/tools/regression.exp b/tools/regression.exp
|
||||
index af3fed9..342a8fa 100755
|
||||
--- a/tools/regression.exp
|
||||
+++ b/tools/regression.exp
|
||||
@@ -842,7 +842,7 @@ false
|
||||
</node_state>
|
||||
</status>
|
||||
</cib>
|
||||
-* Passed: crm_ticket - Default granted-ticket value
|
||||
+* Passed: crm_ticket - Default ticket granted state
|
||||
<cib epoch="18" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
<crm_config>
|
||||
@@ -881,7 +881,7 @@ false
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
-* Passed: crm_ticket - Set granted-ticket value
|
||||
+* Passed: crm_ticket - Set ticket granted state
|
||||
false
|
||||
<cib epoch="18" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
@@ -921,7 +921,7 @@ false
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
-* Passed: crm_ticket - Query granted-ticket value
|
||||
+* Passed: crm_ticket - Query ticket granted state
|
||||
Deleted ticketA state attribute: name=granted
|
||||
<cib epoch="18" num_updates="3" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
@@ -961,4 +961,162 @@ Deleted ticketA state attribute: name=granted
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
-* Passed: crm_ticket - Delete granted-ticket value
|
||||
+* Passed: crm_ticket - Delete ticket granted state
|
||||
+<cib epoch="18" num_updates="4" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
+ <configuration>
|
||||
+ <crm_config>
|
||||
+ <cluster_property_set id="cib-bootstrap-options"/>
|
||||
+ <cluster_property_set id="duplicate">
|
||||
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
||||
+ </cluster_property_set>
|
||||
+ </crm_config>
|
||||
+ <nodes>
|
||||
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
||||
+ <instance_attributes id="nodes-clusterNode-UUID">
|
||||
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
||||
+ </instance_attributes>
|
||||
+ </node>
|
||||
+ </nodes>
|
||||
+ <resources>
|
||||
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
||||
+ <meta_attributes id="dummy-meta_attributes"/>
|
||||
+ <instance_attributes id="dummy-instance_attributes">
|
||||
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
||||
+ </instance_attributes>
|
||||
+ </primitive>
|
||||
+ </resources>
|
||||
+ <constraints/>
|
||||
+ </configuration>
|
||||
+ <status>
|
||||
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
||||
+ <transient_attributes id="clusterNode-UUID">
|
||||
+ <instance_attributes id="status-clusterNode-UUID">
|
||||
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
||||
+ </instance_attributes>
|
||||
+ </transient_attributes>
|
||||
+ </node_state>
|
||||
+ <tickets>
|
||||
+ <ticket_state id="ticketA" standby="true"/>
|
||||
+ </tickets>
|
||||
+ </status>
|
||||
+</cib>
|
||||
+* Passed: crm_ticket - Make a ticket standby
|
||||
+true
|
||||
+<cib epoch="18" num_updates="4" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
+ <configuration>
|
||||
+ <crm_config>
|
||||
+ <cluster_property_set id="cib-bootstrap-options"/>
|
||||
+ <cluster_property_set id="duplicate">
|
||||
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
||||
+ </cluster_property_set>
|
||||
+ </crm_config>
|
||||
+ <nodes>
|
||||
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
||||
+ <instance_attributes id="nodes-clusterNode-UUID">
|
||||
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
||||
+ </instance_attributes>
|
||||
+ </node>
|
||||
+ </nodes>
|
||||
+ <resources>
|
||||
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
||||
+ <meta_attributes id="dummy-meta_attributes"/>
|
||||
+ <instance_attributes id="dummy-instance_attributes">
|
||||
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
||||
+ </instance_attributes>
|
||||
+ </primitive>
|
||||
+ </resources>
|
||||
+ <constraints/>
|
||||
+ </configuration>
|
||||
+ <status>
|
||||
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
||||
+ <transient_attributes id="clusterNode-UUID">
|
||||
+ <instance_attributes id="status-clusterNode-UUID">
|
||||
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
||||
+ </instance_attributes>
|
||||
+ </transient_attributes>
|
||||
+ </node_state>
|
||||
+ <tickets>
|
||||
+ <ticket_state id="ticketA" standby="true"/>
|
||||
+ </tickets>
|
||||
+ </status>
|
||||
+</cib>
|
||||
+* Passed: crm_ticket - Query ticket standby state
|
||||
+<cib epoch="18" num_updates="5" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
+ <configuration>
|
||||
+ <crm_config>
|
||||
+ <cluster_property_set id="cib-bootstrap-options"/>
|
||||
+ <cluster_property_set id="duplicate">
|
||||
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
||||
+ </cluster_property_set>
|
||||
+ </crm_config>
|
||||
+ <nodes>
|
||||
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
||||
+ <instance_attributes id="nodes-clusterNode-UUID">
|
||||
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
||||
+ </instance_attributes>
|
||||
+ </node>
|
||||
+ </nodes>
|
||||
+ <resources>
|
||||
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
||||
+ <meta_attributes id="dummy-meta_attributes"/>
|
||||
+ <instance_attributes id="dummy-instance_attributes">
|
||||
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
||||
+ </instance_attributes>
|
||||
+ </primitive>
|
||||
+ </resources>
|
||||
+ <constraints/>
|
||||
+ </configuration>
|
||||
+ <status>
|
||||
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
||||
+ <transient_attributes id="clusterNode-UUID">
|
||||
+ <instance_attributes id="status-clusterNode-UUID">
|
||||
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
||||
+ </instance_attributes>
|
||||
+ </transient_attributes>
|
||||
+ </node_state>
|
||||
+ <tickets>
|
||||
+ <ticket_state id="ticketA" standby="false"/>
|
||||
+ </tickets>
|
||||
+ </status>
|
||||
+</cib>
|
||||
+* Passed: crm_ticket - Activate a ticket
|
||||
+Deleted ticketA state attribute: name=standby
|
||||
+<cib epoch="18" num_updates="6" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
+ <configuration>
|
||||
+ <crm_config>
|
||||
+ <cluster_property_set id="cib-bootstrap-options"/>
|
||||
+ <cluster_property_set id="duplicate">
|
||||
+ <nvpair id="duplicate-cluster-delay" name="cluster-delay" value="30s"/>
|
||||
+ </cluster_property_set>
|
||||
+ </crm_config>
|
||||
+ <nodes>
|
||||
+ <node id="clusterNode-UUID" uname="clusterNode-UNAME" type="member">
|
||||
+ <instance_attributes id="nodes-clusterNode-UUID">
|
||||
+ <nvpair id="nodes-clusterNode-UUID-ram" name="ram" value="1024M"/>
|
||||
+ </instance_attributes>
|
||||
+ </node>
|
||||
+ </nodes>
|
||||
+ <resources>
|
||||
+ <primitive id="dummy" class="ocf" provider="pacemaker" type="Dummy">
|
||||
+ <meta_attributes id="dummy-meta_attributes"/>
|
||||
+ <instance_attributes id="dummy-instance_attributes">
|
||||
+ <nvpair id="dummy-instance_attributes-delay" name="delay" value="10s"/>
|
||||
+ </instance_attributes>
|
||||
+ </primitive>
|
||||
+ </resources>
|
||||
+ <constraints/>
|
||||
+ </configuration>
|
||||
+ <status>
|
||||
+ <node_state id="clusterNode-UUID" uname="clusterNode-UNAME">
|
||||
+ <transient_attributes id="clusterNode-UUID">
|
||||
+ <instance_attributes id="status-clusterNode-UUID">
|
||||
+ <nvpair id="status-clusterNode-UUID-fail-count-dummy" name="fail-count-dummy" value="10"/>
|
||||
+ </instance_attributes>
|
||||
+ </transient_attributes>
|
||||
+ </node_state>
|
||||
+ <tickets>
|
||||
+ <ticket_state id="ticketA"/>
|
||||
+ </tickets>
|
||||
+ </status>
|
||||
+</cib>
|
||||
+* Passed: crm_ticket - Delete ticket standby state
|
||||
diff --git a/tools/regression.sh b/tools/regression.sh
|
||||
index e8844ec..e7ef151 100755
|
||||
--- a/tools/regression.sh
|
||||
+++ b/tools/regression.sh
|
||||
@@ -171,16 +171,28 @@ function test_tools() {
|
||||
assert $? 0 crm_resource "Un-migrate a resource"
|
||||
|
||||
crm_ticket -t ticketA -G granted -d false
|
||||
- assert $? 0 crm_ticket "Default ticket state attribute"
|
||||
+ assert $? 0 crm_ticket "Default ticket granted state"
|
||||
|
||||
crm_ticket -t ticketA -r --force
|
||||
- assert $? 0 crm_ticket "Set ticket state attribute"
|
||||
+ assert $? 0 crm_ticket "Set ticket granted state"
|
||||
|
||||
crm_ticket -t ticketA -G granted
|
||||
- assert $? 0 crm_ticket "Query ticket state attribute"
|
||||
+ assert $? 0 crm_ticket "Query ticket granted state"
|
||||
|
||||
crm_ticket -t ticketA -D granted --force
|
||||
- assert $? 0 crm_ticket "Delete ticket state attribute"
|
||||
+ assert $? 0 crm_ticket "Delete ticket granted state"
|
||||
+
|
||||
+ crm_ticket -t ticketA -s
|
||||
+ assert $? 0 crm_ticket "Make a ticket standby"
|
||||
+
|
||||
+ crm_ticket -t ticketA -G standby
|
||||
+ assert $? 0 crm_ticket "Query ticket standby state"
|
||||
+
|
||||
+ crm_ticket -t ticketA -a
|
||||
+ assert $? 0 crm_ticket "Activate a ticket"
|
||||
+
|
||||
+ crm_ticket -t ticketA -D standby
|
||||
+ assert $? 0 crm_ticket "Delete ticket standby state"
|
||||
}
|
||||
|
||||
test_tools 2>&1 | sed s/cib-last-written.*\>/\>/ > $test_home/regression.out
|
91
pacemaker-crm_ticket-tests-update.diff
Normal file
91
pacemaker-crm_ticket-tests-update.diff
Normal file
@ -0,0 +1,91 @@
|
||||
commit 729f23fc8b3ba8f11608c5b9f6b44efe89f25db7
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Fri Mar 23 18:08:53 2012 +0800
|
||||
|
||||
Low: Tools: Update CLI regression tests for the new crm_ticket
|
||||
|
||||
diff --git a/tools/regression.exp b/tools/regression.exp
|
||||
index 9c672fb..af3fed9 100755
|
||||
--- a/tools/regression.exp
|
||||
+++ b/tools/regression.exp
|
||||
@@ -806,7 +806,7 @@ Error performing operation: The object/attribute does not exist
|
||||
</status>
|
||||
</cib>
|
||||
* Passed: crm_resource - Un-migrate a resource
|
||||
-scope=tickets name=granted-ticket-ticketA value=false
|
||||
+false
|
||||
<cib epoch="18" num_updates="1" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
<crm_config>
|
||||
@@ -877,14 +877,12 @@ scope=tickets name=granted-ticket-ticketA value=false
|
||||
</transient_attributes>
|
||||
</node_state>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
* Passed: crm_ticket - Set granted-ticket value
|
||||
-scope=tickets name=granted-ticket-ticketA value=false
|
||||
+false
|
||||
<cib epoch="18" num_updates="2" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
<crm_config>
|
||||
@@ -919,13 +917,12 @@ scope=tickets name=granted-ticket-ticketA value=false
|
||||
</transient_attributes>
|
||||
</node_state>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
* Passed: crm_ticket - Query granted-ticket value
|
||||
+Deleted ticketA state attribute: name=granted
|
||||
<cib epoch="18" num_updates="3" admin_epoch="0" validate-with="pacemaker-1.2" >
|
||||
<configuration>
|
||||
<crm_config>
|
||||
@@ -960,7 +957,7 @@ scope=tickets name=granted-ticket-ticketA value=false
|
||||
</transient_attributes>
|
||||
</node_state>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets"/>
|
||||
+ <ticket_state id="ticketA"/>
|
||||
</tickets>
|
||||
</status>
|
||||
</cib>
|
||||
diff --git a/tools/regression.sh b/tools/regression.sh
|
||||
index a6893dc..e8844ec 100755
|
||||
--- a/tools/regression.sh
|
||||
+++ b/tools/regression.sh
|
||||
@@ -170,17 +170,17 @@ function test_tools() {
|
||||
$VALGRIND_CMD crm_resource -r dummy -U
|
||||
assert $? 0 crm_resource "Un-migrate a resource"
|
||||
|
||||
- crm_ticket -t ticketA -G
|
||||
- assert $? 0 crm_ticket "Default granted-ticket value"
|
||||
+ crm_ticket -t ticketA -G granted -d false
|
||||
+ assert $? 0 crm_ticket "Default ticket state attribute"
|
||||
|
||||
- crm_ticket -t ticketA -v false --force
|
||||
- assert $? 0 crm_ticket "Set granted-ticket value"
|
||||
+ crm_ticket -t ticketA -r --force
|
||||
+ assert $? 0 crm_ticket "Set ticket state attribute"
|
||||
|
||||
- crm_ticket -t ticketA -G
|
||||
- assert $? 0 crm_ticket "Query granted-ticket value"
|
||||
+ crm_ticket -t ticketA -G granted
|
||||
+ assert $? 0 crm_ticket "Query ticket state attribute"
|
||||
|
||||
- crm_ticket -t ticketA -D --force
|
||||
- assert $? 0 crm_ticket "Delete granted-ticket value"
|
||||
+ crm_ticket -t ticketA -D granted --force
|
||||
+ assert $? 0 crm_ticket "Delete ticket state attribute"
|
||||
}
|
||||
|
||||
test_tools 2>&1 | sed s/cib-last-written.*\>/\>/ > $test_home/regression.out
|
47
pacemaker-crm_ticket-valgrind.diff
Normal file
47
pacemaker-crm_ticket-valgrind.diff
Normal file
@ -0,0 +1,47 @@
|
||||
commit cb823bb47fabc77ececaad3f2ba3de686e908a89
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Sun Mar 25 12:58:28 2012 +0800
|
||||
|
||||
Low: Tools: Add crm_ticket to be profiled by valgrind
|
||||
|
||||
diff --git a/tools/regression.sh b/tools/regression.sh
|
||||
index e7ef151..7f3c743 100755
|
||||
--- a/tools/regression.sh
|
||||
+++ b/tools/regression.sh
|
||||
@@ -170,28 +170,28 @@ function test_tools() {
|
||||
$VALGRIND_CMD crm_resource -r dummy -U
|
||||
assert $? 0 crm_resource "Un-migrate a resource"
|
||||
|
||||
- crm_ticket -t ticketA -G granted -d false
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -G granted -d false
|
||||
assert $? 0 crm_ticket "Default ticket granted state"
|
||||
|
||||
- crm_ticket -t ticketA -r --force
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -r --force
|
||||
assert $? 0 crm_ticket "Set ticket granted state"
|
||||
|
||||
- crm_ticket -t ticketA -G granted
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -G granted
|
||||
assert $? 0 crm_ticket "Query ticket granted state"
|
||||
|
||||
- crm_ticket -t ticketA -D granted --force
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -D granted --force
|
||||
assert $? 0 crm_ticket "Delete ticket granted state"
|
||||
|
||||
- crm_ticket -t ticketA -s
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -s
|
||||
assert $? 0 crm_ticket "Make a ticket standby"
|
||||
|
||||
- crm_ticket -t ticketA -G standby
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -G standby
|
||||
assert $? 0 crm_ticket "Query ticket standby state"
|
||||
|
||||
- crm_ticket -t ticketA -a
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -a
|
||||
assert $? 0 crm_ticket "Activate a ticket"
|
||||
|
||||
- crm_ticket -t ticketA -D standby
|
||||
+ $VALGRIND_CMD crm_ticket -t ticketA -D standby
|
||||
assert $? 0 crm_ticket "Delete ticket standby state"
|
||||
}
|
||||
|
1139
pacemaker-crm_ticket.diff
Normal file
1139
pacemaker-crm_ticket.diff
Normal file
File diff suppressed because it is too large
Load Diff
23
pacemaker-log-fix.diff
Normal file
23
pacemaker-log-fix.diff
Normal file
@ -0,0 +1,23 @@
|
||||
diff --git a/tools/crm_ticket.c b/tools/crm_ticket.c
|
||||
index f90ba23..51f5180 100644
|
||||
--- a/tools/crm_ticket.c
|
||||
+++ b/tools/crm_ticket.c
|
||||
@@ -676,7 +676,8 @@ main(int argc, char **argv)
|
||||
|
||||
switch (flag) {
|
||||
case 'V':
|
||||
- crm_bump_log_level();
|
||||
+ cl_log_enable_stderr(TRUE);
|
||||
+ alter_debug(DEBUG_INC);
|
||||
break;
|
||||
case '$':
|
||||
case '?':
|
||||
@@ -737,7 +738,7 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (BE_QUIET == FALSE) {
|
||||
- crm_log_args(argc, argv);
|
||||
+ cl_log_args(argc, argv);
|
||||
}
|
||||
|
||||
if (optind < argc && argv[optind] != NULL) {
|
19
pacemaker-ticket-last-granted-prefix.diff
Normal file
19
pacemaker-ticket-last-granted-prefix.diff
Normal file
@ -0,0 +1,19 @@
|
||||
commit 150647923483ae92bac8be05c068134583552b0d
|
||||
Author: Yuusuke Iida <iidayuus@intellilink.co.jp>
|
||||
Date: Mon Feb 20 19:37:46 2012 +0900
|
||||
|
||||
Low: PE: changed a pre-fix to refer to a right value.
|
||||
|
||||
diff --git a/lib/pengine/unpack.c b/lib/pengine/unpack.c
|
||||
index 70bcdc6..34f0e0e 100644
|
||||
--- a/lib/pengine/unpack.c
|
||||
+++ b/lib/pengine/unpack.c
|
||||
@@ -425,7 +425,7 @@ get_ticket_state(gpointer key, gpointer value, gpointer user_data)
|
||||
const char *attr_key = key;
|
||||
|
||||
const char *granted_prefix = "granted-ticket-";
|
||||
- const char *last_granted_prefix = "last-granted-ticket-";
|
||||
+ const char *last_granted_prefix = "last-granted-";
|
||||
static int granted_prefix_strlen = 0;
|
||||
static int last_granted_prefix_strlen = 0;
|
||||
|
10643
pacemaker-ticket-standby-tests.diff
Normal file
10643
pacemaker-ticket-standby-tests.diff
Normal file
File diff suppressed because it is too large
Load Diff
96
pacemaker-ticket-standby.diff
Normal file
96
pacemaker-ticket-standby.diff
Normal file
@ -0,0 +1,96 @@
|
||||
commit de850c422b50d82d09ce820d98d057fae3ea18c9
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Fri Mar 23 12:01:13 2012 +0800
|
||||
|
||||
High: PE: Support to make tickets standby for relinquishing tickets gracefully
|
||||
|
||||
Index: pacemaker/pengine/clone.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/pengine/clone.c
|
||||
+++ pacemaker/pengine/clone.c
|
||||
@@ -522,7 +522,7 @@ clone_color(resource_t * rsc, node_t * p
|
||||
for (; gIter != NULL; gIter = gIter->next) {
|
||||
rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data;
|
||||
|
||||
- if (rsc_ticket->ticket->granted == FALSE) {
|
||||
+ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) {
|
||||
rsc_ticket_constraint(rsc, rsc_ticket, data_set);
|
||||
}
|
||||
}
|
||||
Index: pacemaker/pengine/group.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/pengine/group.c
|
||||
+++ pacemaker/pengine/group.c
|
||||
@@ -68,7 +68,7 @@ group_color(resource_t * rsc, node_t * p
|
||||
for (; gIter != NULL; gIter = gIter->next) {
|
||||
rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data;
|
||||
|
||||
- if (rsc_ticket->ticket->granted == FALSE) {
|
||||
+ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) {
|
||||
rsc_ticket_constraint(rsc, rsc_ticket, data_set);
|
||||
}
|
||||
}
|
||||
Index: pacemaker/pengine/master.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/pengine/master.c
|
||||
+++ pacemaker/pengine/master.c
|
||||
@@ -353,7 +353,8 @@ master_promotion_order(resource_t * rsc,
|
||||
for (; gIter != NULL; gIter = gIter->next) {
|
||||
rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data;
|
||||
|
||||
- if (rsc_ticket->role_lh == RSC_ROLE_MASTER && rsc_ticket->ticket->granted == FALSE) {
|
||||
+ if (rsc_ticket->role_lh == RSC_ROLE_MASTER
|
||||
+ && (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby)) {
|
||||
resource_location(rsc, NULL, -INFINITY, "__stateful_without_ticket__", data_set);
|
||||
}
|
||||
}
|
||||
Index: pacemaker/pengine/native.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/pengine/native.c
|
||||
+++ pacemaker/pengine/native.c
|
||||
@@ -494,7 +494,7 @@ native_color(resource_t * rsc, node_t *
|
||||
for (gIter = rsc->rsc_tickets; gIter != NULL; gIter = gIter->next) {
|
||||
rsc_ticket_t *rsc_ticket = (rsc_ticket_t *) gIter->data;
|
||||
|
||||
- if (rsc_ticket->ticket->granted == FALSE) {
|
||||
+ if (rsc_ticket->ticket->granted == FALSE || rsc_ticket->ticket->standby) {
|
||||
rsc_ticket_constraint(rsc, rsc_ticket, data_set);
|
||||
}
|
||||
}
|
||||
@@ -1401,7 +1401,7 @@ rsc_ticket_constraint(resource_t * rsc_l
|
||||
return;
|
||||
}
|
||||
|
||||
- if (rsc_ticket->ticket->granted == TRUE) {
|
||||
+ if (rsc_ticket->ticket->granted && rsc_ticket->ticket->standby == FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1421,7 +1421,7 @@ rsc_ticket_constraint(resource_t * rsc_l
|
||||
crm_debug_2("%s: Processing ticket dependency on %s (%s, %s)",
|
||||
rsc_lh->id, rsc_ticket->ticket->id, rsc_ticket->id, role2text(rsc_ticket->role_lh));
|
||||
|
||||
- if (g_list_length(rsc_lh->running_on) > 0) {
|
||||
+ if (rsc_ticket->ticket->granted == FALSE && g_list_length(rsc_lh->running_on) > 0) {
|
||||
GListPtr gIter = NULL;
|
||||
|
||||
switch (rsc_ticket->loss_policy) {
|
||||
@@ -1461,11 +1461,17 @@ rsc_ticket_constraint(resource_t * rsc_l
|
||||
break;
|
||||
}
|
||||
|
||||
- } else {
|
||||
+ } else if (rsc_ticket->ticket->granted == FALSE){
|
||||
|
||||
if (rsc_ticket->role_lh != RSC_ROLE_MASTER || rsc_ticket->loss_policy == loss_ticket_stop) {
|
||||
resource_location(rsc_lh, NULL, -INFINITY, "__no_ticket__", data_set);
|
||||
}
|
||||
+
|
||||
+ } else if (rsc_ticket->ticket->standby) {
|
||||
+
|
||||
+ if (rsc_ticket->role_lh != RSC_ROLE_MASTER || rsc_ticket->loss_policy == loss_ticket_stop) {
|
||||
+ resource_location(rsc_lh, NULL, -INFINITY, "__ticket_standby__", data_set);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
565
pacemaker-ticket-state-tests.diff
Normal file
565
pacemaker-ticket-state-tests.diff
Normal file
@ -0,0 +1,565 @@
|
||||
commit 95b5ca54286889209f9a8d609412594047e34c26
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Sat Mar 24 10:48:28 2012 +0800
|
||||
|
||||
Low: PE: Update regression tests for the new ticket state section
|
||||
|
||||
diff --git a/pengine/test10/ticket-clone-11.xml b/pengine/test10/ticket-clone-11.xml
|
||||
index 91e8330..2845018 100644
|
||||
--- a/pengine/test10/ticket-clone-11.xml
|
||||
+++ b/pengine/test10/ticket-clone-11.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-12.xml b/pengine/test10/ticket-clone-12.xml
|
||||
index a7faed0..fc5240e 100644
|
||||
--- a/pengine/test10/ticket-clone-12.xml
|
||||
+++ b/pengine/test10/ticket-clone-12.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-2.xml b/pengine/test10/ticket-clone-2.xml
|
||||
index 464e886..786dc07 100644
|
||||
--- a/pengine/test10/ticket-clone-2.xml
|
||||
+++ b/pengine/test10/ticket-clone-2.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-3.xml b/pengine/test10/ticket-clone-3.xml
|
||||
index b3d8333..cf57e5b 100644
|
||||
--- a/pengine/test10/ticket-clone-3.xml
|
||||
+++ b/pengine/test10/ticket-clone-3.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-5.xml b/pengine/test10/ticket-clone-5.xml
|
||||
index 35ac9a2..e103637 100644
|
||||
--- a/pengine/test10/ticket-clone-5.xml
|
||||
+++ b/pengine/test10/ticket-clone-5.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-6.xml b/pengine/test10/ticket-clone-6.xml
|
||||
index 1d31273..05e01f4 100644
|
||||
--- a/pengine/test10/ticket-clone-6.xml
|
||||
+++ b/pengine/test10/ticket-clone-6.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-8.xml b/pengine/test10/ticket-clone-8.xml
|
||||
index 37ab92c..d8e08ee 100644
|
||||
--- a/pengine/test10/ticket-clone-8.xml
|
||||
+++ b/pengine/test10/ticket-clone-8.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-clone-9.xml b/pengine/test10/ticket-clone-9.xml
|
||||
index 81700a5..d33d515 100644
|
||||
--- a/pengine/test10/ticket-clone-9.xml
|
||||
+++ b/pengine/test10/ticket-clone-9.xml
|
||||
@@ -26,9 +26,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-11.xml b/pengine/test10/ticket-group-11.xml
|
||||
index 7bbc2bc..a60211d 100644
|
||||
--- a/pengine/test10/ticket-group-11.xml
|
||||
+++ b/pengine/test10/ticket-group-11.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-12.xml b/pengine/test10/ticket-group-12.xml
|
||||
index 7a2e239..798b223 100644
|
||||
--- a/pengine/test10/ticket-group-12.xml
|
||||
+++ b/pengine/test10/ticket-group-12.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-2.xml b/pengine/test10/ticket-group-2.xml
|
||||
index f4c8c43..f96cb00 100644
|
||||
--- a/pengine/test10/ticket-group-2.xml
|
||||
+++ b/pengine/test10/ticket-group-2.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-3.xml b/pengine/test10/ticket-group-3.xml
|
||||
index 3746e03..80529d0 100644
|
||||
--- a/pengine/test10/ticket-group-3.xml
|
||||
+++ b/pengine/test10/ticket-group-3.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-5.xml b/pengine/test10/ticket-group-5.xml
|
||||
index 064e211..8e0f935 100644
|
||||
--- a/pengine/test10/ticket-group-5.xml
|
||||
+++ b/pengine/test10/ticket-group-5.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-6.xml b/pengine/test10/ticket-group-6.xml
|
||||
index 0fdda63..1c6fe6a 100644
|
||||
--- a/pengine/test10/ticket-group-6.xml
|
||||
+++ b/pengine/test10/ticket-group-6.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-8.xml b/pengine/test10/ticket-group-8.xml
|
||||
index 4232acb..dc8bb88 100644
|
||||
--- a/pengine/test10/ticket-group-8.xml
|
||||
+++ b/pengine/test10/ticket-group-8.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-group-9.xml b/pengine/test10/ticket-group-9.xml
|
||||
index dfd10c9..b08fdcd 100644
|
||||
--- a/pengine/test10/ticket-group-9.xml
|
||||
+++ b/pengine/test10/ticket-group-9.xml
|
||||
@@ -36,9 +36,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-11.xml b/pengine/test10/ticket-master-11.xml
|
||||
index 151d5fb..0b46eae 100644
|
||||
--- a/pengine/test10/ticket-master-11.xml
|
||||
+++ b/pengine/test10/ticket-master-11.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-12.xml b/pengine/test10/ticket-master-12.xml
|
||||
index 3a238eb..620f2af 100644
|
||||
--- a/pengine/test10/ticket-master-12.xml
|
||||
+++ b/pengine/test10/ticket-master-12.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-2.xml b/pengine/test10/ticket-master-2.xml
|
||||
index b45fe97..7601925 100644
|
||||
--- a/pengine/test10/ticket-master-2.xml
|
||||
+++ b/pengine/test10/ticket-master-2.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-3.xml b/pengine/test10/ticket-master-3.xml
|
||||
index 641b26a..b0bc973 100644
|
||||
--- a/pengine/test10/ticket-master-3.xml
|
||||
+++ b/pengine/test10/ticket-master-3.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-5.xml b/pengine/test10/ticket-master-5.xml
|
||||
index fa15ae2..ab1f797 100644
|
||||
--- a/pengine/test10/ticket-master-5.xml
|
||||
+++ b/pengine/test10/ticket-master-5.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-6.xml b/pengine/test10/ticket-master-6.xml
|
||||
index 2f691b4..02bf6af 100644
|
||||
--- a/pengine/test10/ticket-master-6.xml
|
||||
+++ b/pengine/test10/ticket-master-6.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-8.xml b/pengine/test10/ticket-master-8.xml
|
||||
index 4c7bd42..8df7289 100644
|
||||
--- a/pengine/test10/ticket-master-8.xml
|
||||
+++ b/pengine/test10/ticket-master-8.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-master-9.xml b/pengine/test10/ticket-master-9.xml
|
||||
index b81e762..d4b7979 100644
|
||||
--- a/pengine/test10/ticket-master-9.xml
|
||||
+++ b/pengine/test10/ticket-master-9.xml
|
||||
@@ -32,9 +32,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-11.xml b/pengine/test10/ticket-primitive-11.xml
|
||||
index 8f21e29..5b36f87 100644
|
||||
--- a/pengine/test10/ticket-primitive-11.xml
|
||||
+++ b/pengine/test10/ticket-primitive-11.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-12.xml b/pengine/test10/ticket-primitive-12.xml
|
||||
index 9c7b7f2..7285f7d 100644
|
||||
--- a/pengine/test10/ticket-primitive-12.xml
|
||||
+++ b/pengine/test10/ticket-primitive-12.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-2.xml b/pengine/test10/ticket-primitive-2.xml
|
||||
index 190fe6c..122b7e6 100644
|
||||
--- a/pengine/test10/ticket-primitive-2.xml
|
||||
+++ b/pengine/test10/ticket-primitive-2.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-3.xml b/pengine/test10/ticket-primitive-3.xml
|
||||
index 3f535f1..66d08c8 100644
|
||||
--- a/pengine/test10/ticket-primitive-3.xml
|
||||
+++ b/pengine/test10/ticket-primitive-3.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-5.xml b/pengine/test10/ticket-primitive-5.xml
|
||||
index 60e7df6..c159472 100644
|
||||
--- a/pengine/test10/ticket-primitive-5.xml
|
||||
+++ b/pengine/test10/ticket-primitive-5.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-6.xml b/pengine/test10/ticket-primitive-6.xml
|
||||
index 958ef16..1614d59 100644
|
||||
--- a/pengine/test10/ticket-primitive-6.xml
|
||||
+++ b/pengine/test10/ticket-primitive-6.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-8.xml b/pengine/test10/ticket-primitive-8.xml
|
||||
index 5ed4f6f..89ae6b7 100644
|
||||
--- a/pengine/test10/ticket-primitive-8.xml
|
||||
+++ b/pengine/test10/ticket-primitive-8.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-primitive-9.xml b/pengine/test10/ticket-primitive-9.xml
|
||||
index 4b7225d..80cc4ca 100644
|
||||
--- a/pengine/test10/ticket-primitive-9.xml
|
||||
+++ b/pengine/test10/ticket-primitive-9.xml
|
||||
@@ -27,9 +27,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-rsc-sets-2.xml b/pengine/test10/ticket-rsc-sets-2.xml
|
||||
index b0a8ffd..c6b99e4 100644
|
||||
--- a/pengine/test10/ticket-rsc-sets-2.xml
|
||||
+++ b/pengine/test10/ticket-rsc-sets-2.xml
|
||||
@@ -73,9 +73,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-rsc-sets-3.xml b/pengine/test10/ticket-rsc-sets-3.xml
|
||||
index 96396bb..c86cdda 100644
|
||||
--- a/pengine/test10/ticket-rsc-sets-3.xml
|
||||
+++ b/pengine/test10/ticket-rsc-sets-3.xml
|
||||
@@ -73,9 +73,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-rsc-sets-5.xml b/pengine/test10/ticket-rsc-sets-5.xml
|
||||
index e416852..cae37c3 100644
|
||||
--- a/pengine/test10/ticket-rsc-sets-5.xml
|
||||
+++ b/pengine/test10/ticket-rsc-sets-5.xml
|
||||
@@ -77,9 +77,7 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-rsc-sets-6.xml b/pengine/test10/ticket-rsc-sets-6.xml
|
||||
index dd8f577..5cf50a0 100644
|
||||
--- a/pengine/test10/ticket-rsc-sets-6.xml
|
||||
+++ b/pengine/test10/ticket-rsc-sets-6.xml
|
||||
@@ -77,10 +77,8 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="true"/>
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketB" name="granted-ticket-ticketB" value="true"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="true"/>
|
||||
+ <ticket_state id="ticketB" granted="true"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
||||
diff --git a/pengine/test10/ticket-rsc-sets-7.xml b/pengine/test10/ticket-rsc-sets-7.xml
|
||||
index 7ebbc66..2cd519e 100644
|
||||
--- a/pengine/test10/ticket-rsc-sets-7.xml
|
||||
+++ b/pengine/test10/ticket-rsc-sets-7.xml
|
||||
@@ -77,10 +77,8 @@
|
||||
</configuration>
|
||||
<status>
|
||||
<tickets>
|
||||
- <instance_attributes id="status-tickets">
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketA" name="granted-ticket-ticketA" value="false"/>
|
||||
- <nvpair id="status-tickets-granted-ticket-ticketB" name="granted-ticket-ticketB" value="false"/>
|
||||
- </instance_attributes>
|
||||
+ <ticket_state id="ticketA" granted="false"/>
|
||||
+ <ticket_state id="ticketB" granted="false"/>
|
||||
</tickets>
|
||||
<node_state id="node1" uname="node1" ha="active" in_ccm="true" crmd="online" join="member" expected="member" crm-debug-origin="crm_simulate">
|
||||
<lrm id="node1">
|
364
pacemaker-ticket-state.diff
Normal file
364
pacemaker-ticket-state.diff
Normal file
@ -0,0 +1,364 @@
|
||||
commit f3dea7908cfcc61e83b765b8bda68f6ce1ba31d3
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Fri Mar 23 11:40:56 2012 +0800
|
||||
|
||||
High: PE: Move the ticket state section to "/cib/status/tickets/ticket_state"
|
||||
|
||||
Move the ticket state section:
|
||||
--- "/cib/status/tickets/instance_attributes"
|
||||
+++ "/cib/status/tickets/ticket_state"
|
||||
|
||||
Pengine still recognizes the deprecated section. If there's any
|
||||
attribute appears in the new tickets_state section, it'll take over
|
||||
precedence over the one in the deprecated section. Actually, even
|
||||
more, once crm_ticket is invoked to set an attribute, it'll clear the
|
||||
one in the deprecated section.
|
||||
|
||||
Index: pacemaker/include/crm/msg_xml.h
|
||||
===================================================================
|
||||
--- pacemaker.orig/include/crm/msg_xml.h
|
||||
+++ pacemaker/include/crm/msg_xml.h
|
||||
@@ -297,7 +297,8 @@
|
||||
# define XML_ACL_ATTR_XPATH "xpath"
|
||||
# define XML_ACL_ATTR_ATTRIBUTE "attribute"
|
||||
|
||||
-# define XML_CIB_TAG_TICKETS "tickets"
|
||||
+# define XML_CIB_TAG_TICKETS "tickets"
|
||||
+# define XML_CIB_TAG_TICKET_STATE "ticket_state"
|
||||
|
||||
# include <crm/common/xml.h>
|
||||
|
||||
Index: pacemaker/include/crm/pengine/status.h
|
||||
===================================================================
|
||||
--- pacemaker.orig/include/crm/pengine/status.h
|
||||
+++ pacemaker/include/crm/pengine/status.h
|
||||
@@ -294,6 +294,8 @@ struct ticket_s {
|
||||
char *id;
|
||||
gboolean granted;
|
||||
time_t last_granted;
|
||||
+ gboolean standby;
|
||||
+ GHashTable *state;
|
||||
};
|
||||
|
||||
gboolean cluster_status(pe_working_set_t * data_set);
|
||||
Index: pacemaker/lib/pengine/unpack.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/lib/pengine/unpack.c
|
||||
+++ pacemaker/lib/pengine/unpack.c
|
||||
@@ -412,10 +412,95 @@ unpack_resources(xmlNode * xml_resources
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
+/* The ticket state section:
|
||||
+ * "/cib/status/tickets/ticket_state" */
|
||||
+static gboolean
|
||||
+unpack_ticket_state(xmlNode * xml_ticket, pe_working_set_t * data_set)
|
||||
+{
|
||||
+ const char *ticket_id = NULL;
|
||||
+ const char *granted = NULL;
|
||||
+ const char *last_granted = NULL;
|
||||
+ const char *standby = NULL;
|
||||
+ xmlAttrPtr xIter = NULL;
|
||||
+
|
||||
+ ticket_t *ticket = NULL;
|
||||
+
|
||||
+ ticket_id = ID(xml_ticket);
|
||||
+ if (ticket_id == NULL || strlen(ticket_id) == 0) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ crm_trace("Processing ticket state for %s", ticket_id);
|
||||
+
|
||||
+ ticket = g_hash_table_lookup(data_set->tickets, ticket_id);
|
||||
+ if (ticket == NULL) {
|
||||
+ ticket = ticket_new(ticket_id, data_set);
|
||||
+ if (ticket == NULL) {
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (xIter = xml_ticket->properties; xIter; xIter = xIter->next) {
|
||||
+ const char *prop_name = (const char *)xIter->name;
|
||||
+ const char *prop_value = crm_element_value(xml_ticket, prop_name);
|
||||
+
|
||||
+ if(crm_str_eq(prop_name, XML_ATTR_ID, TRUE)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ g_hash_table_replace(ticket->state, crm_strdup(prop_name), crm_strdup(prop_value));
|
||||
+ }
|
||||
+
|
||||
+ granted = g_hash_table_lookup(ticket->state, "granted");
|
||||
+ if (granted && crm_is_true(granted)) {
|
||||
+ ticket->granted = TRUE;
|
||||
+ crm_info("We have ticket '%s'", ticket->id);
|
||||
+ } else {
|
||||
+ ticket->granted = FALSE;
|
||||
+ crm_info("We do not have ticket '%s'", ticket->id);
|
||||
+ }
|
||||
+
|
||||
+ last_granted = g_hash_table_lookup(ticket->state, "last-granted");
|
||||
+ if (last_granted) {
|
||||
+ ticket->last_granted = crm_parse_int(last_granted, 0);
|
||||
+ }
|
||||
+
|
||||
+ standby = g_hash_table_lookup(ticket->state, "standby");
|
||||
+ if (standby && crm_is_true(standby)) {
|
||||
+ ticket->standby = TRUE;
|
||||
+ if (ticket->granted) {
|
||||
+ crm_info("Granted ticket '%s' is in standby-mode", ticket->id);
|
||||
+ }
|
||||
+ } else {
|
||||
+ ticket->standby = FALSE;
|
||||
+ }
|
||||
+
|
||||
+ crm_trace("Done with ticket state for %s", ticket_id);
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static gboolean
|
||||
+unpack_tickets_state(xmlNode * xml_tickets, pe_working_set_t * data_set)
|
||||
+{
|
||||
+ xmlNode *xml_obj = NULL;
|
||||
+
|
||||
+ for (xml_obj = __xml_first_child(xml_tickets); xml_obj != NULL; xml_obj = __xml_next(xml_obj)) {
|
||||
+ if (crm_str_eq((const char *)xml_obj->name, XML_CIB_TAG_TICKET_STATE, TRUE) == FALSE) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ unpack_ticket_state(xml_obj, data_set);
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+/* Compatibility with the deprecated ticket state section:
|
||||
+ * "/cib/status/tickets/instance_attributes" */
|
||||
static void
|
||||
-get_ticket_state(gpointer key, gpointer value, gpointer user_data)
|
||||
+get_ticket_state_legacy(gpointer key, gpointer value, gpointer user_data)
|
||||
{
|
||||
- const char *attr_key = key;
|
||||
+ const char *long_key = key;
|
||||
+ char *state_key = NULL;
|
||||
|
||||
const char *granted_prefix = "granted-ticket-";
|
||||
const char *last_granted_prefix = "last-granted-";
|
||||
@@ -425,9 +510,10 @@ get_ticket_state(gpointer key, gpointer
|
||||
const char *ticket_id = NULL;
|
||||
const char *is_granted = NULL;
|
||||
const char *last_granted = NULL;
|
||||
+ const char *sep = NULL;
|
||||
|
||||
ticket_t *ticket = NULL;
|
||||
- GHashTable *tickets = user_data;
|
||||
+ pe_working_set_t *data_set = user_data;
|
||||
|
||||
if (granted_prefix_strlen == 0) {
|
||||
granted_prefix_strlen = strlen(granted_prefix);
|
||||
@@ -437,37 +523,41 @@ get_ticket_state(gpointer key, gpointer
|
||||
last_granted_prefix_strlen = strlen(last_granted_prefix);
|
||||
}
|
||||
|
||||
- if (strstr(attr_key, granted_prefix) == attr_key) {
|
||||
- ticket_id = attr_key + granted_prefix_strlen;
|
||||
+ if (strstr(long_key, granted_prefix) == long_key) {
|
||||
+ ticket_id = long_key + granted_prefix_strlen;
|
||||
if (strlen(ticket_id)) {
|
||||
+ state_key = crm_strdup("granted");
|
||||
is_granted = value;
|
||||
}
|
||||
- } else if (strstr(attr_key, last_granted_prefix) == attr_key) {
|
||||
- ticket_id = attr_key + last_granted_prefix_strlen;
|
||||
+ } else if (strstr(long_key, last_granted_prefix) == long_key) {
|
||||
+ ticket_id = long_key + last_granted_prefix_strlen;
|
||||
if (strlen(ticket_id)) {
|
||||
+ state_key = crm_strdup("last-granted");
|
||||
last_granted = value;
|
||||
}
|
||||
+ } else if ((sep = strrchr(long_key, '-'))) {
|
||||
+ ticket_id = sep + 1;
|
||||
+ state_key = strndup(long_key, strlen(long_key) - strlen(sep));
|
||||
}
|
||||
|
||||
if (ticket_id == NULL || strlen(ticket_id) == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
- ticket = g_hash_table_lookup(tickets, ticket_id);
|
||||
+ if (state_key == NULL || strlen(state_key) == 0) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ ticket = g_hash_table_lookup(data_set->tickets, ticket_id);
|
||||
if (ticket == NULL) {
|
||||
- crm_malloc0(ticket, sizeof(ticket_t));
|
||||
+ ticket = ticket_new(ticket_id, data_set);
|
||||
if (ticket == NULL) {
|
||||
- crm_config_err("Cannot allocate ticket '%s'", ticket_id);
|
||||
return;
|
||||
}
|
||||
-
|
||||
- ticket->id = crm_strdup(ticket_id);
|
||||
- ticket->granted = FALSE;
|
||||
- ticket->last_granted = -1;
|
||||
-
|
||||
- g_hash_table_insert(tickets, crm_strdup(ticket->id), ticket);
|
||||
}
|
||||
|
||||
+ g_hash_table_replace(ticket->state, state_key, crm_strdup(value));
|
||||
+
|
||||
if (is_granted) {
|
||||
if (crm_is_true(is_granted)) {
|
||||
ticket->granted = TRUE;
|
||||
@@ -482,15 +572,6 @@ get_ticket_state(gpointer key, gpointer
|
||||
}
|
||||
}
|
||||
|
||||
-static void
|
||||
-destroy_ticket(gpointer data)
|
||||
-{
|
||||
- ticket_t *ticket = data;
|
||||
-
|
||||
- crm_free(ticket->id);
|
||||
- crm_free(ticket);
|
||||
-}
|
||||
-
|
||||
/* remove nodes that are down, stopping */
|
||||
/* create +ve rsc_to_node constraints between resources and the nodes they are running on */
|
||||
/* anything else? */
|
||||
@@ -508,24 +589,32 @@ unpack_status(xmlNode * status, pe_worki
|
||||
|
||||
crm_debug_3("Beginning unpack");
|
||||
|
||||
- data_set->tickets =
|
||||
- g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket);
|
||||
+ if (data_set->tickets == NULL) {
|
||||
+ data_set->tickets =
|
||||
+ g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket);
|
||||
+ }
|
||||
|
||||
for (state = __xml_first_child(status); state != NULL; state = __xml_next(state)) {
|
||||
if (crm_str_eq((const char *)state->name, XML_CIB_TAG_TICKETS, TRUE)) {
|
||||
- xmlNode *tickets = state;
|
||||
- GHashTable *attrs_hash =
|
||||
- g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str,
|
||||
+ xmlNode *xml_tickets = state;
|
||||
+ GHashTable *state_hash = NULL;
|
||||
+
|
||||
+ /* Compatibility with the deprecated ticket state section:
|
||||
+ * Unpack the attributes in the deprecated "/cib/status/tickets/instance_attributes" if it exists. */
|
||||
+ state_hash = g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str,
|
||||
g_hash_destroy_str);
|
||||
|
||||
- unpack_instance_attributes(data_set->input, tickets, XML_TAG_ATTR_SETS, NULL,
|
||||
- attrs_hash, NULL, TRUE, data_set->now);
|
||||
+ unpack_instance_attributes(data_set->input, xml_tickets, XML_TAG_ATTR_SETS, NULL,
|
||||
+ state_hash, NULL, TRUE, data_set->now);
|
||||
|
||||
- g_hash_table_foreach(attrs_hash, get_ticket_state, data_set->tickets);
|
||||
+ g_hash_table_foreach(state_hash, get_ticket_state_legacy, data_set);
|
||||
|
||||
- if (attrs_hash) {
|
||||
- g_hash_table_destroy(attrs_hash);
|
||||
+ if (state_hash) {
|
||||
+ g_hash_table_destroy(state_hash);
|
||||
}
|
||||
+
|
||||
+ /* Unpack the new "/cib/status/tickets/ticket_state"s */
|
||||
+ unpack_tickets_state(xml_tickets, data_set);
|
||||
}
|
||||
|
||||
if (crm_str_eq((const char *)state->name, XML_CIB_TAG_STATE, TRUE)) {
|
||||
Index: pacemaker/lib/pengine/utils.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/lib/pengine/utils.c
|
||||
+++ pacemaker/lib/pengine/utils.c
|
||||
@@ -1373,3 +1373,53 @@ get_target_role(resource_t * rsc, enum r
|
||||
*role = local_role;
|
||||
return TRUE;
|
||||
}
|
||||
+
|
||||
+void
|
||||
+destroy_ticket(gpointer data)
|
||||
+{
|
||||
+ ticket_t *ticket = data;
|
||||
+
|
||||
+ if (ticket->state) {
|
||||
+ g_hash_table_destroy(ticket->state);
|
||||
+ }
|
||||
+ crm_free(ticket->id);
|
||||
+ crm_free(ticket);
|
||||
+}
|
||||
+
|
||||
+ticket_t *
|
||||
+ticket_new(const char *ticket_id, pe_working_set_t * data_set)
|
||||
+{
|
||||
+ ticket_t *ticket = NULL;
|
||||
+
|
||||
+ if (ticket_id == NULL || strlen(ticket_id) == 0) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (data_set->tickets == NULL) {
|
||||
+ data_set->tickets =
|
||||
+ g_hash_table_new_full(crm_str_hash, g_str_equal, g_hash_destroy_str, destroy_ticket);
|
||||
+ }
|
||||
+
|
||||
+ ticket = g_hash_table_lookup(data_set->tickets, ticket_id);
|
||||
+ if (ticket == NULL) {
|
||||
+
|
||||
+ crm_malloc0(ticket, sizeof(ticket_t));
|
||||
+ if (ticket == NULL) {
|
||||
+ crm_err("Cannot allocate ticket '%s'", ticket_id);
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ crm_trace("Creaing ticket entry for %s", ticket_id);
|
||||
+
|
||||
+ ticket->id = crm_strdup(ticket_id);
|
||||
+ ticket->granted = FALSE;
|
||||
+ ticket->last_granted = -1;
|
||||
+ ticket->standby = FALSE;
|
||||
+ ticket->state = g_hash_table_new_full(crm_str_hash, g_str_equal,
|
||||
+ g_hash_destroy_str, g_hash_destroy_str);
|
||||
+
|
||||
+ g_hash_table_insert(data_set->tickets, crm_strdup(ticket->id), ticket);
|
||||
+ }
|
||||
+
|
||||
+ return ticket;
|
||||
+}
|
||||
Index: pacemaker/lib/pengine/utils.h
|
||||
===================================================================
|
||||
--- pacemaker.orig/lib/pengine/utils.h
|
||||
+++ pacemaker/lib/pengine/utils.h
|
||||
@@ -162,4 +162,7 @@ extern gboolean get_target_role(resource
|
||||
extern resource_t *find_clone_instance(resource_t * rsc, const char *sub_id,
|
||||
pe_working_set_t * data_set);
|
||||
|
||||
+extern void destroy_ticket(gpointer data);
|
||||
+extern ticket_t *ticket_new(const char * ticket_id, pe_working_set_t * data_set);
|
||||
+
|
||||
#endif
|
||||
Index: pacemaker/pengine/constraints.c
|
||||
===================================================================
|
||||
--- pacemaker.orig/pengine/constraints.c
|
||||
+++ pacemaker/pengine/constraints.c
|
||||
@@ -2000,17 +2000,10 @@ unpack_rsc_ticket(xmlNode * xml_obj, pe_
|
||||
}
|
||||
|
||||
if (ticket == NULL) {
|
||||
- crm_malloc0(ticket, sizeof(ticket_t));
|
||||
+ ticket = ticket_new(ticket_str, data_set);
|
||||
if (ticket == NULL) {
|
||||
- crm_config_err("Cannot allocate ticket '%s'", ticket_str);
|
||||
return FALSE;
|
||||
}
|
||||
-
|
||||
- ticket->id = crm_strdup(ticket_str);
|
||||
- ticket->granted = FALSE;
|
||||
- ticket->last_granted = -1;
|
||||
-
|
||||
- g_hash_table_insert(data_set->tickets, crm_strdup(ticket->id), ticket);
|
||||
}
|
||||
|
||||
unpack_rsc_ticket_template(xml_obj, &expanded_xml, data_set);
|
97
pacemaker-tickets-crm_simulate.diff
Normal file
97
pacemaker-tickets-crm_simulate.diff
Normal file
@ -0,0 +1,97 @@
|
||||
commit 575e1964464f6df7de7b2fbb688469554cdec44f
|
||||
Author: Gao,Yan <ygao@suse.com>
|
||||
Date: Thu Mar 8 18:40:54 2012 +0800
|
||||
|
||||
Medium: Tools: crm_simulate - Implement the support of granting/revoking tickets for crm_simulate
|
||||
|
||||
diff --git a/tools/crm_inject.c b/tools/crm_inject.c
|
||||
index 44b5cad..610140b 100644
|
||||
--- a/tools/crm_inject.c
|
||||
+++ b/tools/crm_inject.c
|
||||
@@ -758,7 +758,7 @@ create_dotfile(pe_working_set_t * data_set, const char *dot_file, gboolean all_a
|
||||
static void
|
||||
modify_configuration(pe_working_set_t * data_set,
|
||||
const char *quorum, GListPtr node_up, GListPtr node_down, GListPtr node_fail,
|
||||
- GListPtr op_inject)
|
||||
+ GListPtr op_inject, GListPtr ticket_grant, GListPtr ticket_revoke)
|
||||
{
|
||||
int rc = cib_ok;
|
||||
GListPtr gIter = NULL;
|
||||
@@ -817,6 +817,34 @@ modify_configuration(pe_working_set_t * data_set,
|
||||
CRM_ASSERT(rc == cib_ok);
|
||||
}
|
||||
|
||||
+ for (gIter = ticket_grant; gIter != NULL; gIter = gIter->next) {
|
||||
+ char *ticket = (char *)gIter->data;
|
||||
+ char *attr_name = crm_concat("granted-ticket", ticket, '-');
|
||||
+
|
||||
+ quiet_log(" + Granting ticket %s\n", ticket);
|
||||
+ rc = update_attr(global_cib, cib_sync_call | cib_scope_local,
|
||||
+ XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL,
|
||||
+ attr_name, "true", TRUE);
|
||||
+
|
||||
+ crm_free(attr_name);
|
||||
+
|
||||
+ CRM_ASSERT(rc == cib_ok);
|
||||
+ }
|
||||
+
|
||||
+ for (gIter = ticket_revoke; gIter != NULL; gIter = gIter->next) {
|
||||
+ char *ticket = (char *)gIter->data;
|
||||
+ char *attr_name = crm_concat("granted-ticket", ticket, '-');
|
||||
+
|
||||
+ quiet_log(" + Revoking ticket %s\n", ticket);
|
||||
+ rc = update_attr(global_cib, cib_sync_call | cib_scope_local,
|
||||
+ XML_CIB_TAG_TICKETS, NULL, NULL, NULL, NULL,
|
||||
+ attr_name, "false", TRUE);
|
||||
+
|
||||
+ crm_free(attr_name);
|
||||
+
|
||||
+ CRM_ASSERT(rc == cib_ok);
|
||||
+ }
|
||||
+
|
||||
for (gIter = op_inject; gIter != NULL; gIter = gIter->next) {
|
||||
char *spec = (char *)gIter->data;
|
||||
|
||||
@@ -971,6 +999,8 @@ static struct crm_option long_options[] = {
|
||||
{"op-fail", 1, 0, 'F', "\t$rsc_$task_$interval@$node=$rc - Fail the specified task while running the simulation"},
|
||||
{"set-datetime", 1, 0, 't', "Set date/time"},
|
||||
{"quorum", 1, 0, 'q', "\tSpecify a value for quorum"},
|
||||
+ {"ticket-grant", 1, 0, 'g', "Grant a ticket"},
|
||||
+ {"ticket-revoke",1, 0, 'r', "Revoke a ticket"},
|
||||
|
||||
{"-spacer-", 0, 0, '-', "\nOutput Options:"},
|
||||
|
||||
@@ -1090,6 +1120,8 @@ main(int argc, char **argv)
|
||||
GListPtr node_down = NULL;
|
||||
GListPtr node_fail = NULL;
|
||||
GListPtr op_inject = NULL;
|
||||
+ GListPtr ticket_grant = NULL;
|
||||
+ GListPtr ticket_revoke = NULL;
|
||||
|
||||
xmlNode *input = NULL;
|
||||
|
||||
@@ -1163,6 +1195,14 @@ main(int argc, char **argv)
|
||||
modified++;
|
||||
quorum = optarg;
|
||||
break;
|
||||
+ case 'g':
|
||||
+ modified++;
|
||||
+ ticket_grant = g_list_append(ticket_grant, optarg);
|
||||
+ break;
|
||||
+ case 'r':
|
||||
+ modified++;
|
||||
+ ticket_revoke = g_list_append(ticket_revoke, optarg);
|
||||
+ break;
|
||||
case 'a':
|
||||
all_actions = TRUE;
|
||||
break;
|
||||
@@ -1249,7 +1289,8 @@ main(int argc, char **argv)
|
||||
|
||||
if (modified) {
|
||||
quiet_log("Performing requested modifications\n");
|
||||
- modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject);
|
||||
+ modify_configuration(&data_set, quorum, node_up, node_down, node_fail, op_inject,
|
||||
+ ticket_grant, ticket_revoke);
|
||||
|
||||
rc = global_cib->cmds->query(global_cib, NULL, &input, cib_sync_call);
|
||||
if (rc != cib_ok) {
|
@ -1,3 +1,53 @@
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 29 07:39:30 UTC 2012 - lmb@novell.com
|
||||
|
||||
- Add provides to identify support level for tickets (bnc#752241)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 26 04:43:35 UTC 2012 - ygao@suse.com
|
||||
|
||||
- Resolve coverity RESOURCE_LEAK, REVERSE_INULL and UNREACHABLE defects
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 25 14:46:13 UTC 2012 - ygao@suse.com
|
||||
|
||||
- Tools: crm_simulate - Support to grant/revoke/standby/activate
|
||||
tickets from the new ticket state section (bnc#752241)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 25 09:03:42 UTC 2012 - ygao@suse.com
|
||||
|
||||
- Tools: Add crm_ticket to be profiled by valgrind
|
||||
- Tools: crm_ticket - Display the tickets that are referenced in
|
||||
rsc_ticket constraints but have never been granted yet (bnc#752241)
|
||||
- Tools: crm_mon - Support to display tickets (bnc#752242)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Mar 24 10:51:24 UTC 2012 - ygao@suse.com
|
||||
|
||||
- PE: Move the ticket state section to
|
||||
"/cib/status/tickets/ticket_state" (bnc#752241)
|
||||
- PE: Support to make tickets standby for relinquishing tickets
|
||||
gracefully (bnc#752241)
|
||||
- Tools: Implement a new crm_ticket (bnc#752241)
|
||||
- Tools: Update CLI regression tests for the new crm_ticket
|
||||
- Tools: Add CLI regression tests for ticket standby state
|
||||
- PE: Update regression tests for the new ticket state section
|
||||
- PE: Support to make tickets standby for relinquishing tickets
|
||||
gracefully (regression tests)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 20 10:11:52 UTC 2012 - ygao@suse.com
|
||||
|
||||
- Tools: crm_ticket - Granting/revoking tickets need user to confirm
|
||||
unless "--force" option is used (bnc#752269)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Mar 13 09:28:38 UTC 2012 - ygao@suse.com
|
||||
|
||||
- Tools: Implement the support of granting/revoking tickets for
|
||||
crm_simulate (bnc#752241)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Jan 17 05:33:09 UTC 2012 - ygao@suse.com
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%global pcmk_docdir %{_docdir}/%{name}
|
||||
%if 0%{?suse_version}
|
||||
%define _libexecdir %{_libdir}
|
||||
@ -54,14 +55,35 @@ Patch7: pacemaker-abi-compliance.diff
|
||||
Patch8: pacemaker-stonith-timeout.diff
|
||||
Patch9: pacemaker-ptest-xml-text.diff
|
||||
Patch10: pacemaker-cib-new-segfault.diff
|
||||
Patch20: fix-glib_h-include.patch
|
||||
Patch11: pacemaker-tickets-crm_simulate.diff
|
||||
Patch12: pacemaker-crm_ticket-force.diff
|
||||
Patch13: pacemaker-ticket-last-granted-prefix.diff
|
||||
Patch14: pacemaker-ticket-state.diff
|
||||
Patch15: pacemaker-ticket-standby.diff
|
||||
Patch16: pacemaker-crm_ticket.diff
|
||||
Patch17: pacemaker-crm_ticket-tests-update.diff
|
||||
Patch18: pacemaker-crm_ticket-tests-standby.diff
|
||||
Patch19: pacemaker-ticket-state-tests.diff
|
||||
Patch20: pacemaker-ticket-standby-tests.diff
|
||||
Patch21: pacemaker-log-fix.diff
|
||||
Patch22: pacemaker-crm_ticket-valgrind.diff
|
||||
Patch23: pacemaker-crm_ticket-all-tickets.diff
|
||||
Patch24: pacemaker-crm_mon-tickets.diff
|
||||
Patch25: pacemaker-crm_simulate-ticket-state.diff
|
||||
Patch26: pacemaker-coverity-defects.diff
|
||||
Patch100: fix-glib_h-include.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
Provides: pacemaker-ticket-support = 2.0
|
||||
Conflicts: heartbeat < 3.0
|
||||
# We need libglue2, not libheartbeat2
|
||||
Conflicts: libheartbeat2 < 3.0.0
|
||||
PreReq: cluster-glue >= 1.0.6
|
||||
Requires: resource-agents openais python python-xml
|
||||
Requires: libpacemaker3 = %{version}-%{release} python-curses
|
||||
Requires: libpacemaker3 = %{version}-%{release}
|
||||
Requires: openais
|
||||
Requires: python
|
||||
Requires: python-curses
|
||||
Requires: python-xml
|
||||
Requires: resource-agents
|
||||
Recommends: crmsh
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: e2fsprogs-devel
|
||||
@ -154,8 +176,8 @@ Summary: The Pacemaker scalable High-Availability cluster resource manage
|
||||
License: GPL-2.0 ; GPL-2.0+ ; LGPL-2.1+
|
||||
Group: Development/Libraries/C and C++
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: libpacemaker3 = %{version}-%{release}
|
||||
Requires: libglue-devel
|
||||
Requires: libpacemaker3 = %{version}-%{release}
|
||||
%if %with_regression_tests
|
||||
# For the regression tests, we can run them only if all pacemaker
|
||||
# packages are installed, so we pull that in here for the regression
|
||||
@ -193,7 +215,23 @@ Authors:
|
||||
%patch8 -p1
|
||||
%patch9 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%patch12 -p1
|
||||
%patch13 -p1
|
||||
%patch14 -p1
|
||||
%patch15 -p1
|
||||
%patch16 -p1
|
||||
%patch17 -p1
|
||||
%patch18 -p1
|
||||
%patch19 -p1
|
||||
%patch20 -p1
|
||||
%patch21 -p1
|
||||
%patch22 -p1
|
||||
%patch23 -p1
|
||||
%patch24 -p1
|
||||
%patch25 -p1
|
||||
%patch26 -p1
|
||||
%patch100 -p1
|
||||
###########################################################
|
||||
|
||||
%build
|
||||
|
Loading…
x
Reference in New Issue
Block a user