Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: resources by xunsun from 
      ([email protected])
   2. Linux-HA CVS: resources by sunjd from 
      ([email protected])
   3. Linux-HA CVS: lib by sunjd from  ([email protected])


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

Message: 1
Date: Mon, 16 Jan 2006 18:24:17 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by xunsun from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : xunsun
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/heartbeat


Modified Files:
        hto-mapfuncs.in 


Log Message:
correct fix for bug 1034
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/heartbeat/hto-mapfuncs.in,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- hto-mapfuncs.in     16 Jan 2006 17:44:56 -0000      1.12
+++ hto-mapfuncs.in     17 Jan 2006 01:24:16 -0000      1.13
@@ -117,28 +117,54 @@
 }
 
 ra_setenv(){
+       
+       if [ $# -eq 0 ]; then
+           return
+       fi
+
+       # get the first word
+       for envar in $*
+       do
+           assignment=$envar
+           shift
+           break
+       done
 
-       lastenvar=
+       # look forward as far as it can until meeting a word
+       # with ${PARAMETER_SPLIT_SIGN}, then do a setup_OCF_prefix
        for envar in $*
        do
-               ifvarname=`echo $envar | cut -s -d${PARAMETER_SPLIT_SIGN} -f1`
-               if [ -z $ifvarname ]; then
-                       envar="$lastenvar $envar"
-                       setup_OCF_prefix $envar
-               else
-                       setup_OCF_prefix $envar
-               fi
-               lastenvar=$envar
+           case $envar in
+               [!${PARAMETER_SPLIT_SIGN}]*${PARAMETER_SPLIT_SIGN}*)
+                       setup_OCF_prefix $assignment
+                       assignment=$envar
+                       ;;
+               *)      # escape the blank so that eval can deal with it
+                       assignment="$assignment\ $envar"
+                       ;;
+           esac
        done
+                                                                               
 
+       # the last assignment is not performed within the for loop
+        setup_OCF_prefix $assignment
+
 }
 
 setup_OCF_prefix(){
        
-       hbvarname=`echo "$envar" | cut -d${PARAMETER_SPLIT_SIGN} -f1`
-       hbvarvalue=`echo "$envar" | cut -d${PARAMETER_SPLIT_SIGN} -f2`
+       hbvarname=`echo "$*" | cut -s -d${PARAMETER_SPLIT_SIGN} -f1`
+       if [ -z "$hbvarname" ]; then
+           return
+       fi
+
+       hbvarvalue=`echo "$*" | cut -s -d${PARAMETER_SPLIT_SIGN} -f2`
        ocfvarname="OCF_RESKEY_${hbvarname}"
 
-       export `echo $ocfvarname`="$hbvarvalue"
+       # for debug
+       #echo $ocfvarname="$hbvarvalue"
+
+       eval $ocfvarname="$hbvarvalue"
+       export $ocfvarname
 }
 
 setup_OCF_env_vars(){




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

Message: 2
Date: Tue, 17 Jan 2006 00:02:54 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: resources by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : sunjd
Host    : 
Project : linux-ha
Module  : resources

Dir     : linux-ha/resources/heartbeat


Modified Files:
        hto-mapfuncs.in 


Log Message:
rollback to last version after talking with Sun Xun
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/resources/heartbeat/hto-mapfuncs.in,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- hto-mapfuncs.in     17 Jan 2006 01:24:16 -0000      1.13
+++ hto-mapfuncs.in     17 Jan 2006 07:02:54 -0000      1.14
@@ -117,53 +117,28 @@
 }
 
 ra_setenv(){
-       
-       if [ $# -eq 0 ]; then
-           return
-       fi
-
-       # get the first word
-       for envar in $*
-       do
-           assignment=$envar
-           shift
-           break
-       done
 
-       # look forward as far as it can until meeting a word
-       # with ${PARAMETER_SPLIT_SIGN}, then do a setup_OCF_prefix
+       lastenvar=
        for envar in $*
        do
-           case $envar in
-               [!${PARAMETER_SPLIT_SIGN}]*${PARAMETER_SPLIT_SIGN}*)
-                       setup_OCF_prefix $assignment
-                       assignment=$envar
-                       ;;
-               *)      # escape the blank so that eval can deal with it
-                       assignment="$assignment\ $envar"
-                       ;;
-           esac
+               ifvarname=`echo $envar | cut -s -d${PARAMETER_SPLIT_SIGN} -f1`
+               if [ -z $ifvarname ]; then
+                       envar="$lastenvar $envar"
+                       setup_OCF_prefix $envar
+               else
+                       setup_OCF_prefix $envar
+               fi
+               lastenvar=$envar
        done
-                                                                               
 
-       # the last assignment is not performed within the for loop
-        setup_OCF_prefix $assignment
-
 }
 
 setup_OCF_prefix(){
        
-       hbvarname=`echo "$*" | cut -s -d${PARAMETER_SPLIT_SIGN} -f1`
-       if [ -z "$hbvarname" ]; then
-           return
-       fi
-
-       hbvarvalue=`echo "$*" | cut -s -d${PARAMETER_SPLIT_SIGN} -f2`
+       hbvarname=`echo "$envar" | cut -d${PARAMETER_SPLIT_SIGN} -f1`
+       hbvarvalue=`echo "$envar" | cut -d${PARAMETER_SPLIT_SIGN} -f2`
        ocfvarname="OCF_RESKEY_${hbvarname}"
 
-       # for debug
-       #echo $ocfvarname="$hbvarvalue"
-
-       eval $ocfvarname="$hbvarvalue"
+       eval $ocfvarname='$hbvarvalue'
        export $ocfvarname
 }
 




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

Message: 3
Date: Tue, 17 Jan 2006 02:21:13 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : sunjd
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/stonith


Modified Files:
        main.c 


Log Message:
add a new option to output the config names
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/stonith/main.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- main.c      6 Apr 2005 18:58:42 -0000       1.20
+++ main.c      17 Jan 2006 09:21:12 -0000      1.21
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.20 2005/04/06 18:58:42 blaschke Exp $ */
+/* $Id: main.c,v 1.21 2006/01/17 09:21:12 sunjd Exp $ */
 /*
  * Stonith: simple test program for exercising the Stonith API code
  *
@@ -31,7 +31,7 @@
 #include <pils/plugin.h>
 #include <glib.h>
 
-#define        OPTIONS "F:p:t:T:sSlLvhd"
+#define        OPTIONS "F:p:t:T:snSlLvhd"
 #define        EQUAL   '='
 
 extern char *  optarg;
@@ -60,6 +60,8 @@
        fprintf(stream, "\t %s [-svh] "
        "-L\n"
        , cmd);
+       fprintf(stream, "\t %s -n -t stonith-device-type\n"
+       , cmd);
        fprintf(stream, "\t %s [-svh] "
        "-t stonith-device-type "
        "[-p stonith-device-parameters | "
@@ -79,6 +81,7 @@
        fprintf(stream, "\t-S\treport stonith device status\n");
        fprintf(stream, "\t-s\tsilent\n");
        fprintf(stream, "\t-v\tverbose\n");
+       fprintf(stream, "\t-n\toutput the config names of 
stonith-device-parameters\n");
        fprintf(stream, "\t-h\tdisplay detailed help message with stonith 
device desriptions\n");
 
        if (exit_status == 0) {
@@ -184,6 +187,7 @@
        int             silent = 0;
        int             listhosts = 0;
        int             listtypes = 0;
+       int             listparanames = 0;
 
        int             c;
        int             errors = 0;
@@ -243,6 +247,9 @@
                        
                                break;
 
+               case 'n':       ++listparanames;
+                               break;
+
                case 'v':       ++verbose;
                                break;
 
@@ -293,7 +300,7 @@
        argcount = argc - optind;
 
        if (!(argcount == 1 || (argcount < 1
-       &&      (status||listhosts||listtypes)))) {
+       &&      (status||listhosts||listtypes||listparanames)))) {
                ++errors;
        }
 
@@ -317,7 +324,7 @@
                return(0);
        }
 
-       if (optfile == NULL && parameters == NULL && nvcount == 0) {
+       if (!listparanames && optfile == NULL && parameters == NULL && nvcount 
== 0) {
                fprintf(stderr
                ,       "Must specify either -p option, -F option or "
                " name=value style arguments\n");
@@ -340,6 +347,22 @@
                stonith_set_debug(s, debug);
        }
 
+       if (listparanames) {
+               const char**    names;
+               int             i;
+               names = stonith_get_confignames(s);
+
+               if (names != NULL) {
+                       for (i=0; names[i]; ++i) {
+                               printf("%s  ", names[i]);
+                       }
+               }
+               printf("\n");
+               stonith_delete(s); 
+               s=NULL;
+               exit(0);
+       }
+
        /* Old STONITH version 1 stuff... */
        if (optfile) {
                /* Configure the Stonith object from a file */




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

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 26, Issue 39
********************************************

Reply via email to