commit ca9ea8de96463d137f64977a01517bf794d1f4e4
Author: David Vossel <dvossel@redhat.com>
Date: Tue Oct 1 18:26:56 2013 -0500
Fix: fencing: Allow fencing for node after topology entries are deleted
(cherry picked from commit 57de742c237ac5c01b4a7ead70003cbaffed9a3e)
diff --git a/fencing/remote.c b/fencing/remote.c
index 525f1d7..af4fb9e 100644
--- a/fencing/remote.c
+++ b/fencing/remote.c
@@ -374,6 +374,23 @@ remote_op_query_timeout(gpointer data)
return FALSE;
}
+static gboolean
+topology_is_empty(stonith_topology_t *tp)
+{
+ int i;
+
+ if (tp == NULL) {
+ return TRUE;
+ }
+
+ for (i = 0; i < ST_LEVEL_MAX; i++) {
+ if (tp->levels[i] != NULL) {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
static int
stonith_topology_next(remote_fencing_op_t * op)
{
@@ -383,7 +400,7 @@ stonith_topology_next(remote_fencing_op_t * op)
/* Queries don't have a target set */
tp = g_hash_table_lookup(topology, op->target);
}
- if (tp == NULL) {
+ if (topology_is_empty(tp)) {
return pcmk_ok;
}