Exemplo n.º 1
0
void
cib_post_notify(int options, const char *op, crm_data_t *update,
		enum cib_errors result, crm_data_t *new_obj) 
{
	do_cib_notify(
		options, op, update, result, new_obj, T_CIB_UPDATE_CONFIRM);
}
Exemplo n.º 2
0
void
cib_post_notify(int options, const char *op, xmlNode *update,
		enum cib_errors result, xmlNode *new_obj) 
{
	gboolean needed = FALSE;
	g_hash_table_foreach(client_list, need_post_notify, &needed);
	if(needed == FALSE) {
	    return;
	}

	do_cib_notify(
		options, op, update, result, new_obj, T_CIB_UPDATE_CONFIRM);
}
Exemplo n.º 3
0
void
cib_diff_notify(
	int options, const char *client, const char *call_id, const char *op,
	crm_data_t *update, enum cib_errors result, crm_data_t *diff) 
{
	int add_updates = 0;
	int add_epoch  = 0;
	int add_admin_epoch = 0;

	int del_updates = 0;
	int del_epoch  = 0;
	int del_admin_epoch = 0;

	int log_level = LOG_DEBUG_2;
	
	if(diff == NULL) {
		return;
	}

	if(result != cib_ok) {
		log_level = LOG_WARNING;
	}
	
	cib_diff_version_details(
		diff, &add_admin_epoch, &add_epoch, &add_updates, 
		&del_admin_epoch, &del_epoch, &del_updates);

	if(add_updates != del_updates) {
		do_crm_log(log_level,
			      "Update (client: %s%s%s): %d.%d.%d -> %d.%d.%d (%s)",
			      client, call_id?", call:":"", call_id?call_id:"",
			      del_admin_epoch, del_epoch, del_updates,
			      add_admin_epoch, add_epoch, add_updates,
			      cib_error2string(result));

	} else if(diff != NULL) {
		do_crm_log(log_level,
			      "Local-only Change (client:%s%s%s): %d.%d.%d (%s)",
			      client, call_id?", call: ":"", call_id?call_id:"",
			      add_admin_epoch, add_epoch, add_updates,
			      cib_error2string(result));
	}
	
	do_cib_notify(options, op, update, result, diff, T_CIB_DIFF_NOTIFY);
}