[Cluster-devel] cluster/fence/agents baytech/fence_baytech.pl ...
rmccabe at sourceware.org
rmccabe at sourceware.org
Mon Feb 12 20:34:01 UTC 2007
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-02-12 20:33:59
Modified files:
fence/agents/baytech: fence_baytech.pl
fence/agents/bladecenter: fence_bladecenter.pl
fence/agents/brocade: fence_brocade.pl
fence/agents/bullpap: fence_bullpap.pl
fence/agents/cpint: fence_cpint.pl
fence/agents/drac: fence_drac.pl
fence/agents/egenera: fence_egenera.pl
fence/agents/ibmblade: fence_ibmblade.pl
fence/agents/ilo: fence_ilo.pl
fence/agents/mcdata: fence_mcdata.pl
fence/agents/sanbox2: fence_sanbox2.pl
fence/agents/vixel: fence_vixel.pl
fence/agents/wti: fence_wti.pl
fence/agents/xcat: fence_xcat.pl
fence/agents/zvm: fence_zvm.pl
Log message:
Update the perl fence agents to take the additional command line option -S <path> or stdin param passwd_script=<path>
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/baytech/fence_baytech.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/bladecenter/fence_bladecenter.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/brocade/fence_brocade.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/bullpap/fence_bullpap.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.6&r2=1.1.2.7
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/cpint/fence_cpint.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/drac/fence_drac.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.7&r2=1.3.2.8
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/egenera/fence_egenera.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/ibmblade/fence_ibmblade.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.1&r2=1.2.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/ilo/fence_ilo.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.3.2.1&r2=1.3.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/mcdata/fence_mcdata.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/sanbox2/fence_sanbox2.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.1&r2=1.1.2.2
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/vixel/fence_vixel.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/wti/fence_wti.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.2.2.3&r2=1.2.2.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/xcat/fence_xcat.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/zvm/fence_zvm.pl.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1&r2=1.1.2.1
--- cluster/fence/agents/baytech/fence_baytech.pl 2004/06/24 08:53:13 1.1
+++ cluster/fence/agents/baytech/fence_baytech.pl 2007/02/12 20:33:57 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -32,7 +32,7 @@
#BEGIN_VERSION_GENERATION
$FENCE_RELEASE_NAME="";
-$SISTINA_COPYRIGHT="";
+$REDHAT_COPYRIGHT="";
$BUILD_DATE="";
#END_VERSION_GENERATION
@@ -70,6 +70,7 @@
print " -o string action: On,Off,Status or Reboot (default)\n";
print " -n string outlet name\n";
print " -p string password\n";
+ print " -S path script to run to retrieve password\n";
print " -V version\n";
exit 0;
@@ -94,7 +95,7 @@
sub version
{
print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
- print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+ print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
exit 0;
}
@@ -104,7 +105,7 @@
{
$action = "Reboot";
if (@ARGV > 0) {
- getopts("n:l:p:o:a:VhD") || fail_usage ;
+ getopts("n:l:p:S:o:a:VhD") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -130,6 +131,13 @@
$quiet=$opt_q if defined $opt_q;
$user=$opt_l if defined $opt_l;
$passwd=$opt_p if defined $opt_p;
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $passwd=$pwd_script_out;
+ }
+ }
if(defined $passwd && !defined $user)
{
@@ -184,6 +192,10 @@
$opt_p = $val;
}
+ elsif ($name eq "passwd_script") {
+ $opt_S = $val;
+ }
+
elsif ($name eq "action" )
{
$opt_o = $val;
--- cluster/fence/agents/bladecenter/fence_bladecenter.pl 2004/10/25 16:23:03 1.1
+++ cluster/fence/agents/bladecenter/fence_bladecenter.pl 2007/02/12 20:33:57 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -35,7 +35,7 @@
#BEGIN_VERSION_GENERATION
$FENCE_RELEASE_NAME="";
-$SISTINA_COPYRIGHT="";
+$REDHAT_COPYRIGHT="";
$BUILD_DATE="";
#END_VERSION_GENERATION
@@ -53,6 +53,7 @@
print " -n <num> blade number to operate on\n";
print " -o <string> Action: on, off, reboot (default) or status\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -78,7 +79,7 @@
sub version
{
print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
- print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+ print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
exit 0;
}
@@ -129,7 +130,10 @@
elsif ($name eq "passwd" )
{
$passwd = $val;
- }
+ }
+ elsif ($name eq "passwd_script" ) {
+ $passwd_script = $val;
+ }
elsif ($name eq "blade" )
{
$bladenum = $val;
@@ -203,7 +207,7 @@
if (@ARGV > 0)
{
- getopts("a:hl:n:o:p:qv:V") || fail_usage ;
+ getopts("a:hl:n:o:p:S:qv:V") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -216,12 +220,20 @@
$verbose = $opt_v if defined $opt_v;
$quiet = $opt_q if defined $opt_q;
+ if (defined $opt_S) {
+ $pwd_script_output = `$opt_S`;
+ chomp($pwd_script_output);
+ if ($pwd_script_output) {
+ $passwd = $pwd_script_output;
+ }
+ }
+
fail_usage "Unknown parameter." if (@ARGV > 0);
fail_usage "No '-a' flag specified." unless defined $host;
fail_usage "No '-n' flag specified." unless defined $bladenum;
fail_usage "No '-l' flag specified." unless defined $login;
- fail_usage "No '-p' flag specified." unless defined $passwd;
+ fail_usage "No '-p' or '-S' flag specified." unless defined $passwd;
fail_usage "Unrecognised action '$action' for '-o' flag"
unless $action =~ /^(on|off|reboot|status)$/i;
}
@@ -232,9 +244,17 @@
fail "failed: no IP address" unless defined $host;
fail "failed: no blade number" unless defined $bladenum;
fail "failed: no login name" unless defined $login;
- fail "failed: no password" unless defined $passwd;
fail "failed: unrecognised action: $action"
unless $action =~ /^(on|off|reboot|status)$/i;
+
+ if (defined $passwd_script) {
+ $pwd_script_output = `$passwd_script`;
+ chomp($pwd_script_output);
+ if ($pwd_script_output) {
+ $passwd = $pwd_script_output;
+ }
+ }
+ fail "failed: no password" unless defined $passwd;
}
# convert $action to lower case
--- cluster/fence/agents/brocade/fence_brocade.pl 2005/01/07 17:55:00 1.1.2.1
+++ cluster/fence/agents/brocade/fence_brocade.pl 2007/02/12 20:33:57 1.1.2.2
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -46,6 +46,7 @@
print " -n <num> Port number to operate on\n";
print " -o <string> Action: disable (default) or enable\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -78,17 +79,25 @@
if (@ARGV > 0) {
- getopts("a:hl:n:o:p:qV") || fail_usage ;
+ getopts("a:hl:n:o:p:S:qV") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unknown parameter." if (@ARGV > 0);
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
unless $opt_o =~ /^(disable|enable)$/i;
@@ -98,6 +107,15 @@
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
fail "failed: no login name" unless defined $opt_l;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "failed: no password" unless defined $opt_p;
fail "failed: unrecognised action: $opt_o"
unless $opt_o =~ /^(disable|enable)$/i;
@@ -226,6 +244,9 @@
{
$opt_p = $val;
}
+ elsif ($name eq "passwd_script") {
+ $opt_S = $val;
+ }
elsif ($name eq "port" )
{
$opt_n = $val;
--- cluster/fence/agents/bullpap/fence_bullpap.pl 2006/05/16 17:38:10 1.1.2.6
+++ cluster/fence/agents/bullpap/fence_bullpap.pl 2007/02/12 20:33:57 1.1.2.7
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -31,7 +31,7 @@
#BEGIN_VERSION_GENERATION
$FENCE_RELEASE_NAME="";
-$SISTINA_COPYRIGHT="";
+$REDHAT_COPYRIGHT="";
$BUILD_DATE="";
#END_VERSION_GENERATION
@@ -49,17 +49,19 @@
print " -d <domain> Domain to operate on\n";
print " -o <string> Action: on, off, reboot (default) or status\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
print " -V version\n";
print "\n";
print "When run with no arguments, $pname takes arguments from ";
print "standard\ninput, one line per option. They are as follows:\n";
print "\n";
- print " ipaddr=<ip> Same as -a command line option\n";
- print " login=<name> Same as -l command line option\n";
- print " domain=<domain> Same as -d command line option\n";
- print " option=<string> Same as -o command line option\n";
- print " passwd=<string> Same as -p command line option\n\n";
+ print " ipaddr=<ip> Same as -a command line option\n";
+ print " login=<name> Same as -l command line option\n";
+ print " domain=<domain> Same as -d command line option\n";
+ print " option=<string> Same as -o command line option\n";
+ print " passwd=<string> Same as -p command line option\n";
+ print " passwd_script=<path> Same as -S command line option\n\n";
exit 0;
}
@@ -82,7 +84,7 @@
sub version
{
print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
- print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+ print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
exit 0;
}
@@ -138,6 +140,9 @@
{
$passwd = $val;
}
+ elsif ($name eq "passwd_script" ) {
+ $passwd_script = $val;
+ }
elsif ($name eq "domain" )
{
$domain = $val;
@@ -221,7 +226,7 @@
if (@ARGV > 0)
{
- getopts("a:hl:d:o:p:qv:V") || fail_usage ;
+ getopts("a:hl:d:o:p:S:qv:V") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -234,12 +239,20 @@
$verbose = $opt_v if defined $opt_v;
$quiet = $opt_q if defined $opt_q;
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $passwd = $pwd_script_out;
+ }
+ }
+
fail_usage "Unknown parameter." if (@ARGV > 0);
fail_usage "No '-a' flag specified." unless defined $host;
fail_usage "No '-d' flag specified." unless defined $domain;
fail_usage "No '-l' flag specified." unless defined $login;
- fail_usage "No '-p' flag specified." unless defined $passwd;
+ fail_usage "No '-p' or '-S' flag specified." unless defined $passwd;
fail_usage "Unrecognised action '$action' for '-o' flag"
unless $action =~ /^(on|off|reboot|status)$/i;
}
@@ -250,9 +263,17 @@
fail "failed: no IP address" unless defined $host;
fail "failed: no domain" unless defined $domain;
fail "failed: no login name" unless defined $login;
- fail "failed: no password" unless defined $passwd;
fail "failed: unrecognized action: $action"
unless $action =~ /^(on|off|reboot|status)$/i;
+
+ if (defined $passwd_script) {
+ $pwd_script_out = `$passwd_script`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $passwd = $pwd_script_out;
+ }
+ }
+ fail "failed: no password" unless defined $passwd;
}
# convert $action to lower case
--- cluster/fence/agents/cpint/fence_cpint.pl 2004/06/24 08:53:13 1.1
+++ cluster/fence/agents/cpint/fence_cpint.pl 2007/02/12 20:33:57 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
--- cluster/fence/agents/drac/fence_drac.pl 2006/11/27 16:40:42 1.3.2.7
+++ cluster/fence/agents/drac/fence_drac.pl 2007/02/12 20:33:58 1.3.2.8
@@ -3,7 +3,7 @@
###############################################################################
###############################################################################
##
-## Copyright (C) 2006 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2006-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -79,15 +79,17 @@
print " -m <modulename> DRAC/MC module name\n";
print " -o <string> Action: reboot (default), off or on\n";
print " -p <string> Login password\n";
+ print " -S <path> Script to run to retrieve password\n";
print " -q quiet mode\n";
print " -V version\n";
print "\n";
print "CCS Options:\n";
- print " action = \"string\" Action: reboot (default), off or on\n";
- print " debug = \"debugfile\" debugging output file\n";
+ print " action = \"string\" Action: reboot (default), off or on\n";
+ print " debug = \"debugfile\" debugging output file\n";
print " ipaddr = \"ip\" IP address or hostname of DRAC\n";
print " login = \"name\" Login name\n";
- print " passwd = \"string\" Login password\n";
+ print " passwd = \"string\" Login password\n";
+ print " passwd_script = \"path\" Script to run to retrieve password\n";
exit 0;
}
@@ -125,7 +127,7 @@
sub version
{
print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
- print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+ print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
exit 0;
}
@@ -540,7 +542,11 @@
elsif ($name eq "passwd" )
{
$passwd = $val;
- }
+ }
+ elsif ($name eq "passwd_script" )
+ {
+ $passwd_script = $val;
+ }
elsif ($name eq "debug" )
{
$debug = $val;
@@ -572,7 +578,7 @@
# Check parameters
#
if (@ARGV > 0) {
- getopts("a:c:d:D:hl:m:o:p:qVv") || fail_usage ;
+ getopts("a:c:d:D:hl:m:o:p:S:qVv") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -590,7 +596,15 @@
$modulename = $opt_m if defined $opt_m;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
$passwd = $opt_p;
$verbose = $opt_v if defined $opt_v;
@@ -610,9 +624,18 @@
fail "failed: no IP address" unless defined $address;
fail "failed: no login name" unless defined $login;
+
+ if (defined $passwd_script) {
+ $pwd_script_out = `$passwd_script`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $passwd = $pwd_script_out;
+ }
+ }
+
fail "failed: no password" unless defined $passwd;
fail "failed: unrecognised action: $action"
- unless $action =~ /^(Off|On|Reboot|status)$/i;
+ unless $action =~ /^(Off|On|Reboot|status)$/i;
}
--- cluster/fence/agents/egenera/fence_egenera.pl 2006/05/15 20:08:20 1.1.2.1
+++ cluster/fence/agents/egenera/fence_egenera.pl 2007/02/12 20:33:58 1.1.2.2
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
--- cluster/fence/agents/ibmblade/fence_ibmblade.pl 2006/05/15 17:26:43 1.2.2.1
+++ cluster/fence/agents/ibmblade/fence_ibmblade.pl 2007/02/12 20:33:58 1.2.2.2
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
--- cluster/fence/agents/ilo/fence_ilo.pl 2005/07/28 21:51:28 1.3.2.1
+++ cluster/fence/agents/ilo/fence_ilo.pl 2007/02/12 20:33:58 1.3.2.2
@@ -1,4 +1,17 @@
#!/usr/bin/perl
+
+###############################################################################
+###############################################################################
+##
+## Copyright (C) 2006-2007 Red Hat, Inc. All rights reserved.
+##
+## This copyrighted material is made available to anyone wishing to use,
+## modify, copy, or redistribute it subject to the terms and conditions
+## of the GNU General Public License v.2.
+##
+###############################################################################
+###############################################################################
+
$|=1;
eval { $ssl_mod="Net::SSL" if require Net::SSL} ||
@@ -14,6 +27,9 @@
# "#END_VERSION_GENERATION" It is generated by the Makefile
#BEGIN_VERSION_GENERATION
+$FENCE_RELEASE_NAME="";
+$REDHAT_COPYRIGHT="";
+$BUILD_DATE="";
#END_VERSION_GENERATION
# Get the program name from $0 and strip directory names
@@ -35,6 +51,7 @@
print " -l <name> Login name\n";
print " -o <string> Action: reboot (default), off, on or status\n";
print " -p <string> Login password\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
print " -V version\n";
print " -v verbose\n";
@@ -62,7 +79,7 @@
sub version
{
print "$pname $FENCE_RELEASE_NAME $BUILD_DATE\n";
- print "$SISTINA_COPYRIGHT\n" if ( $SISTINA_COPYRIGHT );
+ print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
exit 0;
}
@@ -452,6 +469,10 @@
{
$passwd = $val;
}
+ elsif ($name eq "passwd_script" )
+ {
+ $passwd_script = $val;
+ }
elsif ($name eq "ribcl" )
{
$ribcl_vers = $val;
@@ -475,7 +496,7 @@
$ribcl_vers = undef; # undef = autodetect
if (@ARGV > 0) {
- getopts("a:hl:n:o:p:r:qvV") || fail_usage ;
+ getopts("a:hl:n:o:p:S:r:qvV") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -488,7 +509,15 @@
fail_usage "No '-l' flag specified." unless defined $opt_l;
$username = $opt_l;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
$passwd = $opt_p;
$action = $opt_o if defined $opt_o;
@@ -508,6 +537,15 @@
fail "no host\n" unless defined $hostname;
fail "no login name\n" unless defined $username;
+
+ if (defined $passwd_script) {
+ $pwd_script_out = `$passwd_script`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $passwd = $pwd_script_out;
+ }
+ }
+
fail "no password\n" unless defined $passwd;
fail "unrecognised action: $action\n"
--- cluster/fence/agents/mcdata/fence_mcdata.pl 2004/06/24 08:53:14 1.1
+++ cluster/fence/agents/mcdata/fence_mcdata.pl 2007/02/12 20:33:58 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -53,6 +53,7 @@
print " -n <num> Port number to disable\n";
print " -o <string> Action: disable (default) or enable\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -129,7 +130,11 @@
elsif ($name eq "passwd" )
{
$opt_p = $val;
- }
+ }
+ elsif ($name eq "passwd_script" )
+ {
+ $opt_S = $val;
+ }
elsif ($name eq "port" )
{
$opt_n = $val;
@@ -153,7 +158,7 @@
# MAIN
if (@ARGV > 0) {
- getopts("a:hl:n:o:p:qV") || fail_usage ;
+ getopts("a:hl:n:o:p:S:qV") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -163,7 +168,16 @@
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
unless $opt_o =~ /^(disable|enable)$/i;
@@ -173,6 +187,15 @@
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
fail "failed: no login name" unless defined $opt_l;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "failed: no password" unless defined $opt_p;
fail "failed: unrecognised action: $opt_o"
unless $opt_o =~ /^(disable|enable)$/i;
--- cluster/fence/agents/sanbox2/fence_sanbox2.pl 2005/01/18 00:31:05 1.1.2.1
+++ cluster/fence/agents/sanbox2/fence_sanbox2.pl 2007/02/12 20:33:58 1.1.2.2
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -46,6 +46,7 @@
print " -n <num> Port number to disable\n";
print " -o <string> Action: disable (default) or enable\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
print " -V version\n";
@@ -78,7 +79,7 @@
if (@ARGV > 0) {
- getopts("a:hl:n:o:p:qV") || fail_usage ;
+ getopts("a:hl:n:o:p:S:qV") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -88,7 +89,16 @@
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
fail_usage "No '-l' flag specified." unless defined $opt_l;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
fail_usage "Unrecognised action '$opt_o' for '-o' flag"
unless $opt_o =~ /^(disable|enable)$/i;
@@ -98,6 +108,15 @@
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
fail "failed: no login name" unless defined $opt_l;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "failed: no password" unless defined $opt_p;
fail "failed: unrecognised action: $opt_o"
unless $opt_o =~ /^(disable|enable)$/i;
@@ -222,7 +241,11 @@
elsif ($name eq "passwd" )
{
$opt_p = $val;
- }
+ }
+ elsif ($name eq "passwd_script" )
+ {
+ $opt_S = $val;
+ }
elsif ($name eq "port" )
{
$opt_n = $val;
--- cluster/fence/agents/vixel/fence_vixel.pl 2004/06/24 08:53:15 1.1
+++ cluster/fence/agents/vixel/fence_vixel.pl 2007/02/12 20:33:58 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -40,6 +40,7 @@
print " -h Usage\n";
print " -n <num> Port number to disable\n";
print " -p <string> Password for login\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -V version\n\n";
exit 0;
@@ -70,7 +71,7 @@
}
if (@ARGV > 0) {
- getopts("a:hn:p:V") || fail_usage ;
+ getopts("a:hn:p:S:V") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -78,13 +79,31 @@
fail_usage "Unknown parameter." if (@ARGV > 0);
fail_usage "No '-a' flag specified." unless defined $opt_a;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
fail_usage "No '-n' flag specified." unless defined $opt_n;
} else {
get_options_stdin();
fail "failed: no IP address for the Vixel." unless defined $opt_a;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "failed: no password provided." unless defined $opt_p;
fail "failed: no port number specified." unless defined $opt_n;
}
@@ -130,7 +149,7 @@
($text, $match) = $t->waitfor('/\>/');
if ($text !~ /[Oo][Kk]/) {
- fail "failed: error from switch\n";
+ fail "failed: error from switch\n";
}
$t->print("exit");
@@ -187,6 +206,10 @@
{
$opt_p = $val;
}
+ elsif ($name eq "passwd_script" )
+ {
+ $opt_S = $val;
+ }
elsif ($name eq "port" )
{
--- cluster/fence/agents/wti/fence_wti.pl 2007/01/31 20:00:50 1.2.2.3
+++ cluster/fence/agents/wti/fence_wti.pl 2007/02/12 20:33:58 1.2.2.4
@@ -43,6 +43,7 @@
print " -h usage\n";
print " -n <num> Physical plug number on NPS\n";
print " -p <string> Password if NPS requires one\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -o <operation> Operation to perform (on, off, reboot)\n";
print " -q quiet mode\n";
print " -T test reports state of plug (no power cycle)\n";
@@ -77,7 +78,7 @@
$opt_o = "reboot";
if (@ARGV > 0) {
- getopts("a:hn:p:qTVo:") || fail_usage ;
+ getopts("a:hn:p:S:qTVo:") || fail_usage ;
usage if defined $opt_h;
version if defined $opt_V;
@@ -86,13 +87,31 @@
fail_usage "No '-a' flag specified." unless defined $opt_a;
fail_usage "No '-n' flag specified." unless defined $opt_n;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
} else {
get_options_stdin();
fail "failed: no IP address" unless defined $opt_a;
fail "failed: no plug number" unless defined $opt_n;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "failed: no password" unless defined $opt_p;
}
@@ -338,6 +357,10 @@
{
$opt_p = $val;
}
+ elsif ($name eq "passwd_script" )
+ {
+ $opt_S = $val;
+ }
elsif ($name eq "port" )
{
$opt_n = $val;
--- cluster/fence/agents/xcat/fence_xcat.pl 2004/06/24 08:53:15 1.1
+++ cluster/fence/agents/xcat/fence_xcat.pl 2007/02/12 20:33:58 1.1.2.1
@@ -4,6 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
###############################################################################
###############################################################################
--- cluster/fence/agents/zvm/fence_zvm.pl 2004/06/24 08:53:17 1.1
+++ cluster/fence/agents/zvm/fence_zvm.pl 2007/02/12 20:33:58 1.1.2.1
@@ -4,7 +4,7 @@
###############################################################################
##
## Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
-## Copyright (C) 2004 Red Hat, Inc. All rights reserved.
+## Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
##
## This copyrighted material is made available to anyone wishing to use,
## modify, copy, or redistribute it subject to the terms and conditions
@@ -45,7 +45,8 @@
print " -a <ip> IP address or hostname of the physical s390\n";
print " -h usage\n";
print " -u <string> userid of the virtual machine to fence\n";
- print " -p <string> Password\n";
+ print " -p <string> Password\n";
+ print " -S <path> Script to run to retrieve login password\n";
print " -q quiet mode\n";
print " -r <devnum> ipl device <devnum>\n";
print " -V Version\n";
@@ -267,6 +268,10 @@
{
$opt_p = $val;
}
+ elsif ($name eq "passwd_script" )
+ {
+ $opt_S = $val;
+ }
elsif ($name eq "userid" )
{
$opt_u = $val;
@@ -281,14 +286,23 @@
}
if (@ARGV > 0){
- getopts("a:hp:qr:u:V") || fail_usage;
+ getopts("a:hp:S:qr:u:V") || fail_usage;
usage if defined $opt_h;
version if defined $opt_V;
fail_usage "Unkown parameter." if (@ARGV > 0);
fail_usage "No '-a' flag specified." unless defined $opt_a;
- fail_usage "No '-p' flag specified." unless defined $opt_p;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
+ fail_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
fail_usage "No '-u' flag specified." unless defined $opt_u;
} else {
@@ -296,6 +310,15 @@
fail "no IP address" unless defined $opt_a;
fail "no userid" unless defined $opt_u;
+
+ if (defined $opt_S) {
+ $pwd_script_out = `$opt_S`;
+ chomp($pwd_script_out);
+ if ($pwd_script_out) {
+ $opt_p = $pwd_script_out;
+ }
+ }
+
fail "no password" unless defined $opt_p;
}
More information about the Cluster-devel
mailing list