Showing with 30 additions and 15 deletions.
  1. +1 −0 include/crm/pengine/status.h
  2. +10 −10 lib/pengine/utils.c
  3. +1 −1 pengine/allocate.c
  4. +1 −1 pengine/master.c
  5. +14 −3 tools/crm_failcount
  6. +3 −0 tools/crm_simulate.c
@@ -84,6 +84,7 @@ enum pe_find {

# define pe_flag_quick_location 0x00100000ULL
# define pe_flag_sanitized 0x00200000ULL
# define pe_flag_stdout 0x00400000ULL

typedef struct pe_working_set_s {
xmlNode *input;
@@ -2110,21 +2110,22 @@ fencing_action_digest_cmp(resource_t * rsc, node_t * node, pe_working_set_t * da

} else if(digest_secure && data->digest_secure_calc) {
if(strstr(digest_secure, search_secure)) {
if (is_set(data_set->flags, pe_flag_sanitized)) {
if (is_set(data_set->flags, pe_flag_stdout)) {
printf("Only 'private' parameters to %s for unfencing %s changed\n",
rsc->id, node->details->uname);
}
data->rc = RSC_DIGEST_MATCH;
}
}

if (data->rc == RSC_DIGEST_ALL && is_set(data_set->flags, pe_flag_sanitized) && data->digest_secure_calc) {
if (is_set(data_set->flags, pe_flag_sanitized)) {
printf("Parameters to %s for unfencing %s changed, try '%s:%s:%s'\n",
rsc->id, node->details->uname, rsc->id,
(const char *) g_hash_table_lookup(rsc->meta, XML_ATTR_TYPE),
data->digest_secure_calc);
}
if (is_set(data_set->flags, pe_flag_sanitized)
&& is_set(data_set->flags, pe_flag_stdout)
&& (data->rc == RSC_DIGEST_ALL)
&& data->digest_secure_calc) {
printf("Parameters to %s for unfencing %s changed, try '%s:%s:%s'\n",
rsc->id, node->details->uname, rsc->id,
(const char *) g_hash_table_lookup(rsc->meta, XML_ATTR_TYPE),
data->digest_secure_calc);
}

free(key);
@@ -2236,8 +2237,7 @@ pe_fence_op(node_t * node, const char *op, bool optional, const char *reason, pe
if(data->rc == RSC_DIGEST_ALL) {
optional = FALSE;
crm_notice("Unfencing %s (remote): because the definition of %s changed", node->details->uname, match->id);
if (is_set(data_set->flags, pe_flag_sanitized)) {
/* Extra detail for those running from the commandline */
if (is_set(data_set->flags, pe_flag_stdout)) {
fprintf(stdout, " notice: Unfencing %s (remote): because the definition of %s changed\n", node->details->uname, match->id);
}
}
@@ -316,7 +316,7 @@ check_action_definition(resource_t * rsc, node_t * active_node, xmlNode * xml_op
&& digest_secure
&& digest_data->digest_secure_calc
&& strcmp(digest_data->digest_secure_calc, digest_secure) == 0) {
if (is_set(data_set->flags, pe_flag_sanitized)) {
if (is_set(data_set->flags, pe_flag_stdout)) {
printf("Only 'private' parameters to %s_%s_%d on %s changed: %s\n",
rsc->id, task, interval, active_node->details->uname,
crm_element_value(xml_op, XML_ATTR_TRANSITION_MAGIC));
@@ -766,7 +766,7 @@ master_color(resource_t * rsc, node_t * prefer, pe_working_set_t * data_set)

chosen = child_rsc->fns->location(child_rsc, NULL, FALSE);
if (show_scores) {
if (is_set(data_set->flags, pe_flag_sanitized)) {
if (is_set(data_set->flags, pe_flag_stdout)) {
printf("%s promotion score on %s: %s\n",
child_rsc->id,
(chosen? chosen->details->uname : "none"), score);
@@ -111,14 +111,25 @@ query_attr_sum() {

# Extract the attribute values (one per line) from the output
QAS_VALUE=$(echo "$QAS_ALL" | sed -n -e \
's/.*<nvpair.*value="\([0-9][0-9]*\)".*>.*/\1/p')
's/.*<nvpair.*value="\([0-9][0-9]*\|INFINITY\)".*>.*/\1/p')

# Sum the values
QAS_SUM=0
for i in 0 $QAS_VALUE; do
QAS_SUM=$(($QAS_SUM + $i))
if [ "$i" = "INFINITY" ]; then
QAS_SUM="INFINITY"
break
else
QAS_SUM=$(($QAS_SUM + $i))
fi
done
echo $QAS_SUM
if [ "$QAS_SUM" = "INFINITY" ]; then
echo $QAS_SUM
elif [ "$QAS_SUM" -ge 1000000 ]; then
echo "INFINITY"
else
echo $QAS_SUM
fi
}

query_failcount() {
@@ -800,6 +800,7 @@ main(int argc, char **argv)
if(xml_file) {
set_bit(data_set.flags, pe_flag_sanitized);
}
set_bit(data_set.flags, pe_flag_stdout);
cluster_status(&data_set);

if (quiet == FALSE) {
@@ -838,6 +839,7 @@ main(int argc, char **argv)
if(xml_file) {
set_bit(data_set.flags, pe_flag_sanitized);
}
set_bit(data_set.flags, pe_flag_stdout);
cluster_status(&data_set);
}

@@ -894,6 +896,7 @@ main(int argc, char **argv)
get_date(&data_set);

quiet_log("\nRevised cluster status:\n");
set_bit(data_set.flags, pe_flag_stdout);
cluster_status(&data_set);
print_cluster_status(&data_set, 0);
}