[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.06-13-ga2d8eb2



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=a2d8eb2d13f854b22184e1948f5e5cfa1c107be8

The branch, master has been updated
       via  a2d8eb2d13f854b22184e1948f5e5cfa1c107be8 (commit)
       via  b28980808835bc248d658cc0d8771b1f847e9d06 (commit)
      from  6818dd7db3d7a1a91192889966f5cf6bd942047a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a2d8eb2d13f854b22184e1948f5e5cfa1c107be8
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jul 16 21:27:32 2008 +0200

    [RGMANAGER] Port all resource agents to new ccs interface
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

commit b28980808835bc248d658cc0d8771b1f847e9d06
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Wed Jul 16 15:49:39 2008 +0200

    [CCS] Kill obsolted ccs_test
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

-----------------------------------------------------------------------

Summary of changes:
 ccs/man/Makefile                                 |    5 +
 {config/tools => ccs}/man/ccs_test.8             |    0 
 config/tools/Makefile                            |    2 +-
 config/tools/ccs_test/Makefile                   |   32 -----
 config/tools/ccs_test/ccs_test.c                 |  147 ----------------------
 config/tools/man/Makefile                        |    2 +-
 rgmanager/src/resources/apache.sh                |   11 +--
 rgmanager/src/resources/mysql.sh                 |   12 +--
 rgmanager/src/resources/named.sh                 |   11 +--
 rgmanager/src/resources/openldap.sh              |   12 +--
 rgmanager/src/resources/postgres-8.sh            |   12 +--
 rgmanager/src/resources/samba.sh                 |   12 +--
 rgmanager/src/resources/tomcat-5.sh              |   12 +--
 rgmanager/src/resources/utils/config-utils.sh.in |   59 +--------
 rgmanager/src/resources/utils/messages.sh        |    4 -
 15 files changed, 26 insertions(+), 307 deletions(-)
 rename {config/tools => ccs}/man/ccs_test.8 (100%)
 delete mode 100644 config/tools/ccs_test/Makefile
 delete mode 100644 config/tools/ccs_test/ccs_test.c

diff --git a/ccs/man/Makefile b/ccs/man/Makefile
index f98df0d..43133a6 100644
--- a/ccs/man/Makefile
+++ b/ccs/man/Makefile
@@ -4,4 +4,9 @@ TARGET= cluster.conf.5 \
 	ccs_tool.8
 
 include ../../make/defines.mk
+
+ifdef legacy_code
+TARGET += ccs_test.8
+endif
+
 include $(OBJDIR)/make/man.mk
diff --git a/config/tools/man/ccs_test.8 b/ccs/man/ccs_test.8
similarity index 100%
rename from config/tools/man/ccs_test.8
rename to ccs/man/ccs_test.8
diff --git a/config/tools/Makefile b/config/tools/Makefile
index e2defcf..8b2d2fc 100644
--- a/config/tools/Makefile
+++ b/config/tools/Makefile
@@ -1,4 +1,4 @@
 include ../../make/defines.mk
 include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=ccs_test ldap man
+SUBDIRS=ldap man
diff --git a/config/tools/ccs_test/Makefile b/config/tools/ccs_test/Makefile
deleted file mode 100644
index f0ebddc..0000000
--- a/config/tools/ccs_test/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-TARGET= ccs_test
-
-SBINDIRT=$(TARGET)
-
-all: depends ${TARGET}
-
-include ../../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-OBJS=	ccs_test.o
-
-CFLAGS += -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
-CFLAGS += -I${ccsincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${ccslibdir} -lccs
-
-
-${TARGET}: ${OBJS}
-	$(CC) -o $@ $^ $(LDFLAGS)
-
-depends:
-	$(MAKE) -C ../../libs all
-
-clean: generalclean
-
-.PHONY: all ${TARGET}
-
--include $(OBJS:.o=.d)
diff --git a/config/tools/ccs_test/ccs_test.c b/config/tools/ccs_test/ccs_test.c
deleted file mode 100644
index 6e6cfa0..0000000
--- a/config/tools/ccs_test/ccs_test.c
+++ /dev/null
@@ -1,147 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <string.h>
-
-#include "ccs.h"
-
-#include "copyright.cf"
-
-static void print_usage(FILE *stream);
-
-static int disconnect() {
-	if (ccs_disconnect(1) < 0)
-		return 1;
-
-	return 0;
-}
-
-int main(int argc, char *argv[]){
-  int desc=0;
-  int i=0;
-  int error = 0;
-  int force = 0, blocking = 0;
-  char *str=NULL;
-  char *cluster_name = NULL;
-
-  if(argc <= 1){
-    print_usage(stderr);
-    exit(EXIT_FAILURE);
-  }
-
-  for(i=1; i < argc; i++){
-    if(!strcmp(argv[i], "-h")){
-      print_usage(stdout);
-      exit(EXIT_SUCCESS);
-    }
-    if(!strcmp(argv[i], "-V")){
-      printf("%s %s (built %s %s)\n", argv[0], RELEASE_VERSION, __DATE__, __TIME__);
-      printf("%s\n", REDHAT_COPYRIGHT);
-      exit(EXIT_SUCCESS);
-    }
-  }
-
-  if(!strcmp(argv[1], "connect")){
-    for(i=2; i < argc; i++){
-      if(!strcmp(argv[i], "force")){
-	printf("Force is set.\n");
-	force = 1;
-      } else if(!strcmp(argv[i], "block")){
-	printf("Blocking is set.\n");
-	blocking = 1;
-      } else {
-	cluster_name = argv[i];
-	printf("Setting cluster name to %s\n", cluster_name);
-      }
-    }
-    if(blocking && !force){
-      fprintf(stderr, "Blocking can only be used with \"force\".\n");
-      exit(EXIT_FAILURE);
-    }
-    if(force){
-      desc = ccs_force_connect(cluster_name, blocking);
-    } else {
-      if(cluster_name){
-	fprintf(stderr, "A cluster name can only be specified when using 'force'.\n");
-	exit(EXIT_FAILURE);
-      }
-      desc = ccs_connect();
-    }
-    if(desc < 0){
-      fprintf(stderr, "ccs_connect failed: %s\n", strerror(-desc));
-      exit(EXIT_FAILURE);
-    } else {
-      printf("Connect successful.\n");
-      printf(" Connection descriptor = %d\n", desc);
-      disconnect();
-    }
-  }
-  else if(!strcmp(argv[1], "disconnect")){
-    if(argc < 3){
-      fprintf(stderr, "Wrong number of arguments.\n");
-      exit(EXIT_FAILURE);
-    }
-    desc = ccs_connect();
-    if((error = disconnect())){
-      fprintf(stderr, "ccs_disconnect failed: %s\n", strerror(-error));
-      exit(EXIT_FAILURE);
-    } else {
-      printf("Disconnect successful.\n");
-    }
-  }
-  else if(!strcmp(argv[1], "get")){
-    if(argc < 4){
-      fprintf(stderr, "Wrong number of arguments.\n");
-      exit(EXIT_FAILURE);
-    }
-    desc = ccs_connect();
-    if((desc < 0) || (error = ccs_get(desc, argv[3], &str))){
-      fprintf(stderr, "ccs_get failed: %s\n", strerror(-error));
-      exit(EXIT_FAILURE);
-    } else {
-      printf("Get successful.\n");
-      printf(" Value = <%s>\n", str);
-      if(str)free(str);
-      disconnect();
-    }
-  }
-  else if(!strcmp(argv[1], "set")){
-    if(argc < 5){
-      fprintf(stderr, "Wrong number of arguments.\n");
-      exit(EXIT_FAILURE);
-    }
-    desc = ccs_connect();
-    if((desc < 0) || (error = ccs_set(desc, argv[3], argv[4]))){
-      fprintf(stderr, "ccs_set failed: %s\n", strerror(-error));
-      exit(EXIT_FAILURE);
-    } else {
-      printf("Set successful.\n");
-      disconnect();
-    }
-  }
-  else {
-    fprintf(stderr, "Unknown command: %s\n", argv[1]);
-    exit(EXIT_FAILURE);
-  }
-
-  exit(EXIT_SUCCESS);
-}
-
-
-static void print_usage(FILE *stream){
-  fprintf(stream,
-	  "Usage:\n"
-	  "\n"
-	  "ccs_test [Options] <Command>\n"
-	  "\n"
-	  "Options:\n"
-	  "  -h                        Print usage.\n"
-	  "  -V                        Print version information.\n"
-	  "\n"
-	  "Commands:\n"
-	  "  connect <force> <block>   Connect to CCS and return connection descriptor.\n"
-	  "  disconnect <desc>         Disconnect from CCS.\n"
-	  "  get <desc> <request>      Get a value from CCS.\n"
-	  "  set <desc> <path> <val>   Set a value in CCS.\n"
-	  );
-}
diff --git a/config/tools/man/Makefile b/config/tools/man/Makefile
index 8fe29bf..ee4d874 100644
--- a/config/tools/man/Makefile
+++ b/config/tools/man/Makefile
@@ -1,4 +1,4 @@
-TARGET= ccs_test.8 confdb2ldif.8
+TARGET= confdb2ldif.8
 
 include ../../../make/defines.mk
 include $(OBJDIR)/make/man.mk
diff --git a/rgmanager/src/resources/apache.sh b/rgmanager/src/resources/apache.sh
index 0573a38..7f86838 100644
--- a/rgmanager/src/resources/apache.sh
+++ b/rgmanager/src/resources/apache.sh
@@ -138,7 +138,6 @@ EOT
 
 start()
 {
-	declare ccs_fd
 	declare ip_addresses
 
 	clog_service_start $CLOG_INIT	
@@ -155,14 +154,8 @@ start()
 
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-	ccs_fd=$(ccs_connect);
-	if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-		return $OCF_ERR_GENERIC
-	fi
-	
-	get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-	ip_addresses=`build_ip_list "$ccs_fd"`
+	get_service_ip_keys "$OCF_RESKEY_service_name"
+	ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/mysql.sh b/rgmanager/src/resources/mysql.sh
index b7b0fcf..7afd22f 100644
--- a/rgmanager/src/resources/mysql.sh
+++ b/rgmanager/src/resources/mysql.sh
@@ -51,8 +51,6 @@ verify_all()
 
 start()
 {
-	declare ccs_fd;
-	
 	clog_service_start $CLOG_INIT
 
 	create_pid_directory
@@ -69,14 +67,8 @@ start()
 	else
 		clog_looking_for $CLOG_INIT "IP Address"
 
-	        ccs_fd=$(ccs_connect);
-	        if [ $? -ne 0 ]; then
-			clog_looking_for $CLOG_FAILED_CCS
-	                return $OCF_ERR_GENERIC
-	        fi
-
-	        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-	        ip_addresses=`build_ip_list "$ccs_fd"`
+	        get_service_ip_keys "$OCF_RESKEY_service_name"
+	        ip_addresses=`build_ip_list`
 
 		if [ -n "$ip_addresses" ]; then
 			for i in $ip_addresses; do
diff --git a/rgmanager/src/resources/named.sh b/rgmanager/src/resources/named.sh
index 685eefd..c8f65bb 100644
--- a/rgmanager/src/resources/named.sh
+++ b/rgmanager/src/resources/named.sh
@@ -83,7 +83,6 @@ generate_config_file()
 
 start()
 {
-	declare ccs_fd;
 	declare ip_list;
 	
 	clog_service_start $CLOG_INIT
@@ -99,14 +98,8 @@ start()
 	fi
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-        ccs_fd=$(ccs_connect);
-        if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-                return $OCF_ERR_GENERIC
-        fi
-
-        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list "$ccs_fd"`
+        get_service_ip_keys "$OCF_RESKEY_service_name"
+        ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/openldap.sh b/rgmanager/src/resources/openldap.sh
index 1f17a4e..49ff81f 100644
--- a/rgmanager/src/resources/openldap.sh
+++ b/rgmanager/src/resources/openldap.sh
@@ -100,8 +100,6 @@ generate_config_file()
 
 start()
 {
-	declare ccs_fd;
-	
 	clog_service_start $CLOG_INIT
 
 	create_pid_directory
@@ -115,14 +113,8 @@ start()
 	fi
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-        ccs_fd=$(ccs_connect);
-        if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-                return $OCF_ERR_GENERIC
-        fi
-
-        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list "$ccs_fd"`
+        get_service_ip_keys "$OCF_RESKEY_service_name"
+        ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/postgres-8.sh b/rgmanager/src/resources/postgres-8.sh
index 3716be6..9e21ee8 100644
--- a/rgmanager/src/resources/postgres-8.sh
+++ b/rgmanager/src/resources/postgres-8.sh
@@ -93,8 +93,6 @@ generate_config_file()
 
 start()
 {
-	declare ccs_fd;
-	
 	clog_service_start $CLOG_INIT
 
 	create_pid_directory
@@ -109,14 +107,8 @@ start()
 
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-        ccs_fd=$(ccs_connect);
-        if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-                return $OCF_ERR_GENERIC
-        fi
-
-        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list "$ccs_fd"`
+        get_service_ip_keys "$OCF_RESKEY_service_name"
+        ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/samba.sh b/rgmanager/src/resources/samba.sh
index bb7862e..1990803 100644
--- a/rgmanager/src/resources/samba.sh
+++ b/rgmanager/src/resources/samba.sh
@@ -82,8 +82,6 @@ generate_config_file()
 
 start()
 {
-	declare ccs_fd;
-	
 	clog_service_start $CLOG_INIT
 
 	create_pid_directory
@@ -107,14 +105,8 @@ start()
 
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-        ccs_fd=$(ccs_connect);
-        if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-                return $OCF_ERR_GENERIC
-        fi
-
-        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list "$ccs_fd"`
+        get_service_ip_keys "$OCF_RESKEY_service_name"
+        ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/tomcat-5.sh b/rgmanager/src/resources/tomcat-5.sh
index 2cc814b..37a5a21 100644
--- a/rgmanager/src/resources/tomcat-5.sh
+++ b/rgmanager/src/resources/tomcat-5.sh
@@ -134,8 +134,6 @@ generate_config_file()
 
 start()
 {
-	declare ccs_fd;
-	
 	clog_service_start $CLOG_INIT
 
 	create_pid_directory
@@ -149,14 +147,8 @@ start()
 	fi
 	clog_looking_for $CLOG_INIT "IP Addresses"
 
-        ccs_fd=$(ccs_connect);
-        if [ $? -ne 0 ]; then
-		clog_looking_for $CLOG_FAILED_CCS
-                return $OCF_ERR_GENERIC
-        fi
-
-        get_service_ip_keys "$ccs_fd" "$OCF_RESKEY_service_name"
-        ip_addresses=`build_ip_list "$ccs_fd"`
+        get_service_ip_keys "$OCF_RESKEY_service_name"
+        ip_addresses=`build_ip_list`
 
 	if [ -z "$ip_addresses" ]; then
 		clog_looking_for $CLOG_FAILED_NOT_FOUND "IP Addresses"
diff --git a/rgmanager/src/resources/utils/config-utils.sh.in b/rgmanager/src/resources/utils/config-utils.sh.in
index 76355fa..6ece354 100644
--- a/rgmanager/src/resources/utils/config-utils.sh.in
+++ b/rgmanager/src/resources/utils/config-utils.sh.in
@@ -47,60 +47,18 @@ sha1_verify()
 }
 
 #
-# Usage: ccs_connect
-# Returns: $FAIL on failure, or a connection descriptor on success
-#
-ccs_connect()
-{
-	declare outp
-
-	outp=$(ccs_test connect 2>&1)
-	if [ $? -ne 0 ]; then
-		ocf_log err "$outp"
-		return $FAIL
-	fi
-
-	outp=${outp/*= /}
-	if [ -n "$outp" ]; then
-		echo $outp
-		return 0
-	fi
-
-	return 1
-}
-
-#
-# Usage: ccs_disconnect descriptor
-#
-ccs_disconnect()
-{
-	declare outp
-
-	[ -n "$1" ] || return $FAIL
-	outp=$(ccs_test disconnect $1 2>&1)
-	if [ $? -ne 0 ]; then
-		ocf_log warn "Disconnect CCS desc $1 failed: $outp"
-		return 1
-	fi
-	return 0
-}
-
-#
-# Usage: ccs_get desc key
+# Usage: ccs_get key
 #
 ccs_get()
 {
 	declare outp
-	declare ccsfd=$1
 	declare key
 
 	[ -n "$1" ] || return $FAIL
-	[ -n "$2" ] || return $FAIL
 
-	shift
 	key="$*"
 
-	outp=$(ccs_test get $ccsfd "$key" 2>&1)
+	outp=$(ccs_tool query -c "$key" 2>&1)
 	if [ $? -ne 0 ]; then
 		if [ "$outp" = "${outp/No data available/}" ]; then
 			ocf_log err "$outp ($key)"
@@ -125,17 +83,11 @@ ccs_get()
 #
 get_service_ip_keys()
 {
-	declare ccsfd=$1
 	declare svc=$2
 	declare -i x y=0
 	declare outp
 	declare key
 
-	if [ $ccsfd -eq $FAIL ]; then
-		ocf_log err "Can not talk to ccsd: invalid descriptor $ccsfd"
-		return 1
-	fi
-
 	#
 	# Find service-local IP keys
 	#
@@ -146,7 +98,7 @@ get_service_ip_keys()
 		#
 		# Try direct method
 		#
-		outp=$(ccs_get $ccsfd "$key/@address")
+		outp=$(ccs_get "$key/@address")
 		if [ $? -ne 0 ]; then
 			return 1
 		fi
@@ -155,7 +107,7 @@ get_service_ip_keys()
 		# Try by reference
 		#
 		if [ -z "$outp" ]; then
-			outp=$(ccs_get $ccsfd "$key/@ref")
+			outp=$(ccs_get "$key/@ref")
 			if [ $? -ne 0 ]; then
 				return 1
 			fi
@@ -181,12 +133,11 @@ get_service_ip_keys()
 
 build_ip_list()
 {
-        declare -i ccsfd=$1
         declare ipaddrs ipaddr
         declare -i x=0
                         
         while [ -n "${ip_keys[$x]}" ]; do
-              ipaddr=$(ccs_get $ccsfd "${ip_keys[$x]}/@address")
+              ipaddr=$(ccs_get "${ip_keys[$x]}/@address")
               if [ -z "$ipaddr" ]; then
                                    break
               fi
diff --git a/rgmanager/src/resources/utils/messages.sh b/rgmanager/src/resources/utils/messages.sh
index f57ef3d..6148fa6 100644
--- a/rgmanager/src/resources/utils/messages.sh
+++ b/rgmanager/src/resources/utils/messages.sh
@@ -5,7 +5,6 @@ declare CLOG_SUCCEED=200
 
 declare CLOG_FAILED=400
 declare CLOG_FAILED_TIMEOUT=401
-declare CLOG_FAILED_CCS=402
 declare CLOG_FAILED_NOT_FOUND=403
 declare CLOG_FAILED_INVALID=404
 declare CLOG_FAILED_NOT_READABLE=405
@@ -236,9 +235,6 @@ clog_looking_for()
 		$CLOG_FAILED)
 			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed"
 			;;		
-		$CLOG_FAILED_CCS)
-			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed - Unable To Connect To \"ccs\""
-			;;		
 		$CLOG_FAILED_NOT_FOUND)
 			ocf_log error "Looking For $2 [$OCF_RESOURCE_INSTANCE] > Failed - No $2 Found"
 			;;		


hooks/post-receive
--
Cluster Project


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]