30 [
CRM_alert_rc] = {
"CRM_notify_rc",
"CRM_alert_rc", NULL},
59 entry->
id = strdup(
id);
60 entry->
path = strdup(path);
77 g_hash_table_destroy(entry->
envvars);
119 crm_trace(
"Unsetting alert key %s", *key);
130 crm_trace(
"Inserting alert key %s = '%s'", *key, value);
132 g_hash_table_insert(table, strdup(*key), strdup(value));
134 g_hash_table_remove(table, *key);
144 crm_trace(
"Inserting alert key %s = %d", *key, value);
145 g_hash_table_insert(table, strdup(*key), crm_itoa(value));
150 set_envvar(gpointer key, gpointer value, gpointer user_data)
152 gboolean always_unset = GPOINTER_TO_INT(user_data);
154 crm_trace(
"%s environment variable %s='%s'",
155 (value?
"Setting" :
"Unsetting"),
156 (
char*)key, (value? (
char*)value :
""));
157 if (value && !always_unset) {
168 g_hash_table_foreach(entry->
envvars, set_envvar, GINT_TO_POINTER(FALSE));
179 g_hash_table_foreach(entry->
envvars, set_envvar, GINT_TO_POINTER(TRUE));
183 #define XPATH_PATCHSET1_DIFF "//" F_CIB_UPDATE_RESULT "//" XML_TAG_DIFF_ADDED
185 #define XPATH_PATCHSET1_CRMCONFIG XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_CRMCONFIG
186 #define XPATH_PATCHSET1_ALERTS XPATH_PATCHSET1_DIFF "//" XML_CIB_TAG_ALERTS
188 #define XPATH_PATCHSET1_EITHER \
189 XPATH_PATCHSET1_CRMCONFIG " | " XPATH_PATCHSET1_ALERTS
191 #define XPATH_CONFIG "/" XML_TAG_CIB "/" XML_CIB_TAG_CONFIGURATION
193 #define XPATH_CRMCONFIG XPATH_CONFIG "/" XML_CIB_TAG_CRMCONFIG "/"
194 #define XPATH_ALERTS XPATH_CONFIG "/" XML_CIB_TAG_ALERTS
211 xmlNode *change = NULL;
212 xmlXPathObject *xpathObj = NULL;
230 }
else if (format == 2) {
231 for (change = __xml_first_child(patchset); change != NULL; change = __xml_next(change)) {
243 xmlNode *section = NULL;
244 const char *name = NULL;
247 ((section = __xml_first_child(change)) == NULL) ||
248 ((name = crm_element_name(section)) == NULL) ||
260 crm_warn(
"Unknown patch format: %d", format);
#define CRM_CHECK(expr, failure_action)
const char * crm_alert_keys[CRM_ALERT_INTERNAL_KEY_MAX][3]
xmlNode * get_message_xml(xmlNode *msg, const char *field)
const char * pcmk_strerror(int rc)
#define CRM_ALERT_DEFAULT_TIMEOUT_MS
void crm_unset_envvar_list(crm_alert_entry_t *entry)
void crm_set_envvar_list(crm_alert_entry_t *entry)
int crm_element_value_int(const xmlNode *data, const char *name, int *dest)
Retrieve the integer value of an XML attribute.
crm_alert_entry_t * crm_dup_alert_entry(crm_alert_entry_t *entry)
#define XPATH_PATCHSET1_EITHER
#define crm_warn(fmt, args...)
#define XPATH_PATCHSET1_ALERTS
void crm_unset_alert_keys(void)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
#define crm_trace(fmt, args...)
int setenv(const char *name, const char *value, int why)
#define CRM_ALERT_NODE_SEQUENCE
#define F_CIB_UPDATE_RESULT
void crm_insert_alert_key_int(GHashTable *table, enum crm_alert_keys_e name, int value)
bool crm_patchset_contains_alert(xmlNode *msg, bool config)
xmlXPathObjectPtr xpath_search(xmlNode *xml_top, const char *path)
GHashTable * crm_str_table_dup(GHashTable *old_table)
crm_alert_entry_t * crm_alert_entry_new(const char *id, const char *path)
Create a new alert entry structure.
char ** select_attribute_name
void crm_insert_alert_key(GHashTable *table, enum crm_alert_keys_e name, const char *value)
#define XML_CIB_TAG_ALERTS
void freeXpathObject(xmlXPathObjectPtr xpathObj)
void crm_free_alert_entry(crm_alert_entry_t *entry)
#define CRM_ALERT_INTERNAL_KEY_MAX