cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: lhh@sourceware.org <lhh@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/rgmanager/src/daemons Makefile resrule ...
Date: 26 Jan 2007 18:59:12 -0000	[thread overview]
Message-ID: <20070126185912.25831.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	lhh at sourceware.org	2007-01-26 18:59:11

Modified files:
	rgmanager/src/daemons: Makefile resrules.c reslist.c 

Log message:
	Log resource rule & instance collisions when not running rg_test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/Makefile.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.5&r2=1.6.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.9.2.5&r2=1.9.2.6
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/reslist.c.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.6.2.7&r2=1.6.2.8

--- cluster/rgmanager/src/daemons/Makefile	2006/05/26 17:39:32	1.6.2.5
+++ cluster/rgmanager/src/daemons/Makefile	2007/01/26 18:59:11	1.6.2.6
@@ -59,7 +59,7 @@
 # packages should run 'make check' as part of the build process.
 #
 rg_test: rg_locks-noccs.o test-noccs.o reslist-noccs.o \
-		resrules.o restree-noccs.o fo_domain-noccs.o
+		resrules-noccs.o restree-noccs.o fo_domain-noccs.o
 	$(CC) -o $@ $^ $(INCLUDE) $(CFLAGS) -llalloc $(LDFLAGS)
 
 clurmtabd: clurmtabd.o clurmtabd_lib.o
--- cluster/rgmanager/src/daemons/resrules.c	2006/12/13 18:19:56	1.9.2.5
+++ cluster/rgmanager/src/daemons/resrules.c	2007/01/26 18:59:11	1.9.2.6
@@ -31,7 +31,9 @@
 #include <pthread.h>
 #include <dirent.h>
 #include <libgen.h>
+#ifndef NO_CCS
 #include <clulog.h>
+#endif
 
 
 /**
@@ -49,14 +51,25 @@
 
 	list_do(rulelist, curr) {
 		if (!strcmp(newrule->rr_type, curr->rr_type)) {
+#ifdef NO_CCS
 			fprintf(stderr, "Error storing %s: Duplicate\n",
 				newrule->rr_type);
+#else
+			clulog(LOG_ERR, "Error storing %s: Duplicate\n",
+				newrule->rr_type);
+#endif
 			return -1;
 		}
 		if (newrule->rr_root && curr->rr_root) {
+#ifdef NO_CCS
 			fprintf(stderr, "Error storing %s: root "
 				"resource type %s exists already\n",
 				newrule->rr_type, curr->rr_type);
+#else
+			clulog(LOG_ERR, "Error storing %s: root "
+				"resource type %s exists already\n",
+				newrule->rr_type, curr->rr_type);
+#endif
 			return -1;
 		}
 
@@ -988,9 +1001,15 @@
 			break;
 		
 		if (!strcasecmp(type, "action")) {
+#ifdef NO_CCS
 			fprintf(stderr,
 				"Error: Resource type '%s' is reserved",
 				type);
+#else
+			clulog(LOG_ERR,
+				"Error: Resource type '%s' is reserved",
+				type);
+#endif
 			free(type);
 			break;
 		}
--- cluster/rgmanager/src/daemons/reslist.c	2006/12/13 18:19:56	1.6.2.7
+++ cluster/rgmanager/src/daemons/reslist.c	2007/01/26 18:59:11	1.6.2.8
@@ -29,6 +29,9 @@
 #include <list.h>
 #include <reslist.h>
 #include <pthread.h>
+#ifndef NO_CCS
+#include <clulog.h>
+#endif
 
 
 char *attr_value(resource_node_t *node, char *attrname);
@@ -339,12 +342,29 @@
 					/*
 					   Unique/primary is not unique
 					 */
-					printf("Unique/primary not unique "
-					       "type %s, %s=%s\n",
+#ifdef NO_CCS
+					printf("Error: "
+                                               "%s attribute collision. "
+                                               "type=%s attr=%s value=%s\n",
+					       (newres->r_attrs[x].ra_flags&
+                                                RA_PRIMARY)?"Primary":
+                                               "Unique",
+					       newres->r_rule->rr_type,
+					       newres->r_attrs[x].ra_name,
+					       newres->r_attrs[x].ra_value
+					       );
+#else 
+					clulog(LOG_ERR,
+                                               "%s attribute collision. "
+                                               "type=%s attr=%s value=%s\n",
+					       (newres->r_attrs[x].ra_flags&
+                                                RA_PRIMARY)?"Primary":
+                                               "Unique",
 					       newres->r_rule->rr_type,
 					       newres->r_attrs[x].ra_name,
 					       newres->r_attrs[x].ra_value
 					       );
+#endif
 					return -1;
 				}
 				break;
@@ -743,8 +763,15 @@
 				break;
 
 		       if (store_resource(reslist, newres) != 0) {
+#ifdef NO_CCS
 	       		       printf("Error storing %s resource\n",
 				      newres->r_rule->rr_type);
+#else
+	       		       clulog(LOG_ERR,
+				      "Error storing %s resource\n",
+				      newres->r_rule->rr_type);
+#endif
+
 			       destroy_resource(newres);
 		       }
 



                 reply	other threads:[~2007-01-26 18:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070126185912.25831.qmail@sourceware.org \
    --to=lhh@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).