From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12730 invoked by alias); 3 Jul 2008 03:59:13 -0000 Received: (qmail 12688 invoked by uid 9702); 3 Jul 2008 03:59:12 -0000 Date: Thu, 03 Jul 2008 03:59:00 -0000 Message-ID: <20080703035912.12672.qmail@sourceware.org> From: fabbione@sourceware.org To: cluster-cvs@sources.redhat.com, cluster-devel@redhat.com Subject: Cluster Project branch, STABLE2, updated. cluster-2.03.04-38-g272fe5f X-Git-Refname: refs/heads/STABLE2 X-Git-Reftype: branch X-Git-Oldrev: f632dfc8c99199fb0b6acc77fd3697c8c82bf33b X-Git-Newrev: 272fe5f76ecc45a452ccf06631778520706786a4 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2008-q3/txt/msg00009.txt.bz2 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=272fe5f76ecc45a452ccf06631778520706786a4 The branch, STABLE2 has been updated via 272fe5f76ecc45a452ccf06631778520706786a4 (commit) via 2a54f044b684d068dd6250f259d1e3e4d13ec94d (commit) via 746418c142992700afff7810ad6219c233414df0 (commit) via 0440edaaa4cb14bd5b94c0ee3863cce9d8ba8310 (commit) via cc76b979138565f07feb5af69da93cfffa931889 (commit) via 0ef4c7671685637371f6da22de5315aa3426edfd (commit) via de78c677c218a369bf1c5332d2b5dc88883c5899 (commit) from f632dfc8c99199fb0b6acc77fd3697c8c82bf33b (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 272fe5f76ecc45a452ccf06631778520706786a4 Author: Fabio M. Di Nitto Date: Thu Jul 3 05:46:11 2008 +0200 [BUILD] Fix install of telnet_ssl Signed-off-by: Fabio M. Di Nitto commit 2a54f044b684d068dd6250f259d1e3e4d13ec94d Author: Marek 'marx' Grac Date: Wed Jul 2 15:55:48 2008 +0200 [FENCE] Bug #448822: fence_ilo doesn't work with iLO New fencing agent for iLO used ssh/telnet to connect, but unfortutely there is a problem with power off. This is why we need to use SSL connection and RIBCL commands. As there is no (?) telnet with ssl connection in RHEL we need one to be able to use same infrastructure as in other agents. This agent was not tested with RIBCL version < 2.0 (these part where just ported from the old perl fencing agent) @todo: we have to put telnet_ssl.py somewhere, I'm not sure where commit 746418c142992700afff7810ad6219c233414df0 Author: Fabio M. Di Nitto Date: Tue Jul 1 10:07:02 2008 +0200 [MISC] Documentation cleanup Move all licence and copyright bits into doc/ Add doc/Makefile and use DOCS= infrastructure to install all documentation. Signed-off-by: Fabio M. Di Nitto commit 0440edaaa4cb14bd5b94c0ee3863cce9d8ba8310 Author: Fabio M. Di Nitto Date: Tue Jul 1 09:58:35 2008 +0200 [BUILD] Fix docdir default path Signed-off-by: Fabio M. Di Nitto commit cc76b979138565f07feb5af69da93cfffa931889 Author: Fabio M. Di Nitto Date: Tue Jul 1 09:47:05 2008 +0200 [BUILD] Allow configuration of docdir Signed-off-by: Fabio M. Di Nitto commit 0ef4c7671685637371f6da22de5315aa3426edfd Author: Fabio M. Di Nitto Date: Wed Jun 25 09:09:41 2008 +0200 [CCS] Remove duplicate header Signed-off-by: Fabio M. Di Nitto commit de78c677c218a369bf1c5332d2b5dc88883c5899 Author: Fabio M. Di Nitto Date: Wed Jun 25 07:09:25 2008 +0200 [GFS2] hexedit does not need syslog Signed-off-by: Fabio M. Di Nitto ----------------------------------------------------------------------- Summary of changes: Makefile | 3 +- ccs/daemon/misc.c | 1 - configure | 7 ++ COPYING.applications => doc/COPYING.applications | 0 COPYING.libraries => doc/COPYING.libraries | 0 COPYRIGHT => doc/COPYRIGHT | 0 doc/Makefile | 17 ++++ README.licence => doc/README.licence | 0 fence/agents/ilo/fence_ilo.py | 99 ++++++++++++++-------- fence/agents/lib/Makefile | 2 +- fence/agents/lib/fencing.py.py | 10 ++- fence/agents/lib/telnet_ssl.py | 66 ++++++++++++++ gfs2/edit/hexedit.c | 2 - make/defines.mk.input | 1 + 14 files changed, 165 insertions(+), 43 deletions(-) rename COPYING.applications => doc/COPYING.applications (100%) rename COPYING.libraries => doc/COPYING.libraries (100%) rename COPYRIGHT => doc/COPYRIGHT (100%) create mode 100644 doc/Makefile rename README.licence => doc/README.licence (100%) create mode 100644 fence/agents/lib/telnet_ssl.py diff --git a/Makefile b/Makefile index 98d59f2..0a2c3bc 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ include make/defines.mk REALSUBDIRS = gnbd-kernel/src gfs-kernel/src/gfs \ - cman/lib ccs cman dlm group fence gfs gfs2 gnbd rgmanager + cman/lib ccs cman dlm group fence gfs gfs2 gnbd rgmanager \ + doc SUBDIRS = $(filter-out \ $(if ${without_gnbd-kernel/src},gnbd-kernel/src) \ diff --git a/ccs/daemon/misc.c b/ccs/daemon/misc.c index 62b43d1..eb6e0bd 100644 --- a/ccs/daemon/misc.c +++ b/ccs/daemon/misc.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/configure b/configure index bc4b700..65a7c26 100755 --- a/configure +++ b/configure @@ -64,6 +64,7 @@ my %options = ( sbindir => \$sbindir, initddir => \$initddir, sharedir => \$sharedir, + docdir => \$docdir, mibdir => \$mibdir, snmpbin => \$snmpbin, confdir => \$confdir, @@ -135,6 +136,7 @@ my $err = &GetOptions (\%options, 'sbindir=s', 'initddir=s', 'sharedir=s', + 'docdir=s', 'mibdir=s', 'snmpbin=s', 'confdir=s', @@ -175,6 +177,7 @@ if ($help || !$err) { print "--libdir=\tthe base directory for libraries. (Default: {prefix}/lib)\n"; print "--libexecdir=\tthe base directory for executable components. (Default: {prefix}/libexec)\n"; print "--sharedir=\tthe base directory for misc cluster files. (Default: {prefix}/share/cluster)\n"; + print "--docdir=\tthe base directory for misc cluster documentation files. (Default: {prefix}/share/doc/cluster)\n"; print "--mibdir=\tthe base directory for snmp mibs. (Default: {prefix}/share/snmp/mibs)\n"; print "--snmpbin=\tthe base directory for snmp binaries (Ex: /usr/bin/snmpwalk). (Default: {prefix}/bin)\n"; print "--confdir=\tthe cluster config directory. (Default: /etc/cluster)\n"; @@ -482,6 +485,9 @@ if (!$initddir) { if (!$sharedir) { $sharedir="${prefix}/share/cluster"; } +if (!$docdir) { + $docdir="${prefix}/share/doc/cluster"; +} if (!$mibdir) { $mibdir="${prefix}/share/snmp/mibs"; } @@ -621,6 +627,7 @@ while () { $_ =~ s/\@SBINDIR\@/$sbindir/; $_ =~ s/\@INITDDIR\@/$initddir/; $_ =~ s/\@SHAREDIR\@/$sharedir/; + $_ =~ s/\@DOCDIR\@/$docdir/; $_ =~ s/\@MIBDIR\@/$mibdir/; $_ =~ s/\@SNMPBIN\@/$snmpbin/; $_ =~ s/\@CONFDIR\@/$confdir/; diff --git a/COPYING.applications b/doc/COPYING.applications similarity index 100% rename from COPYING.applications rename to doc/COPYING.applications diff --git a/COPYING.libraries b/doc/COPYING.libraries similarity index 100% rename from COPYING.libraries rename to doc/COPYING.libraries diff --git a/COPYRIGHT b/doc/COPYRIGHT similarity index 100% rename from COPYRIGHT rename to doc/COPYRIGHT diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..db61e0b --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,17 @@ +DOCS = gfs2.txt \ + journaling.txt \ + min-gfs.txt \ + usage.txt \ + COPYING.applications \ + COPYING.libraries \ + COPYRIGHT \ + README.licence + +all: + +include ../make/defines.mk +include $(OBJDIR)/make/install.mk +include $(OBJDIR)/make/uninstall.mk +include $(OBJDIR)/make/clean.mk + +clean: generalclean diff --git a/README.licence b/doc/README.licence similarity index 100% rename from README.licence rename to doc/README.licence diff --git a/fence/agents/ilo/fence_ilo.py b/fence/agents/ilo/fence_ilo.py index 60c4f56..e050ea8 100644 --- a/fence/agents/ilo/fence_ilo.py +++ b/fence/agents/ilo/fence_ilo.py @@ -4,16 +4,17 @@ ## ## The Following Agent Has Been Tested On: ## -## iLO Version +## iLO Version ## +---------------------------------------------+ -## iLO Advanced 1.91 -## -## @note: We can't use conn.sendline because we need to send CR/LF +## iLO / firmware 1.91 / RIBCL 2.22 +## iLO2 / firmware 1.22 / RIBCL 2.22 +## iLO2 / firmware 1.50 / RIBCL 2.22 ##### -import sys, re, pexpect +import sys, re, pexpect, socket sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * +from OpenSSL import SSL #BEGIN_VERSION_GENERATION RELEASE_VERSION="New ILO Agent - test release on steroids" @@ -22,55 +23,79 @@ BUILD_DATE="March, 2008" #END_VERSION_GENERATION def get_power_status(conn, options): - try: - conn.send("POWER\r\n") - conn.log_expect(options, options["-c"], SHELL_TIMEOUT) - except pexpect.EOF: - fail(EC_CONNECTION_LOST) - except pexpect.TIMEOUT: - fail(EC_TIMED_OUT) - - status = re.compile("server power is currently: (.*)", re.IGNORECASE).search(conn.before).group(1) + conn.send("\r\n") + conn.send("\r\n") + conn.send("\r\n") + conn.log_expect(options, "HOST_POWER=\"(.*?)\"", POWER_TIMEOUT) + + status = conn.match.group(1) return status.lower().strip() def set_power_status(conn, options): - action = { - 'on' : "powerup", - 'off': "powerdown" - }[options["-o"]] + conn.send("\r\n") + conn.send("") - try: - conn.send("power " + options["-o"] + "\r\n") - conn.log_expect(options, options["-c"], POWER_TIMEOUT) - except pexpect.EOF: - fail(EC_CONNECTION_LOST) - except pexpect.TIMEOUT: - fail(EC_TIMED_OUT) + if options.has_key("fw_processor") and options["fw_processor"] == "iLO2": + if options["fw_version"] > 1.29: + conn.send("\r\n") + else: + conn.send("\r\n") + elif options["-r"] < 2.21: + conn.send("\r\n") + else: + if options["-o"] == "off": + conn.send("\r\n") + else: + conn.send("\r\n") + conn.send("\r\n") + + return def main(): device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", "action", "ipaddr", "login", "passwd", "passwd_script", - "secure", "ribcl" ] + "ssl", "ribcl" ] options = check_input(device_opt, process_input(device_opt)) - ## - ## Fence agent specific defaults - ##### - if 0 == options.has_key("-c"): - options["-c"] = "hpiLO->" + options["-z"] = 1 + LOGIN_TIMEOUT = 10 ## - ## Operate the fencing device + ## Login and get version number #### conn = fence_login(options) - fence_action(conn, options, set_power_status, get_power_status) + try: + conn.send("\r\n") + conn.log_expect(options, [ "", "" ], LOGIN_TIMEOUT) + version = re.compile("= 2: + conn.send("\r\n") + else: + conn.send("\r\n") + + conn.send("\r\n") + if options["-r"] >= 2: + conn.send("\r\n") + conn.send("\r\n") + conn.log_expect(options, "", SHELL_TIMEOUT) + options["fw_version"] = float(re.compile("FIRMWARE_VERSION\s*=\s*\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1)) + options["fw_processor"] = re.compile("MANAGEMENT_PROCESSOR\s*=\s*\"(.*?)\"", re.IGNORECASE).search(conn.before).group(1) + conn.send("\r\n") + except pexpect.TIMEOUT: + fail(EC_LOGIN_DENIED) ## - ## Logout from system - ###### - conn.send("quit\r\n") - conn.close() + ## Fence operations + #### + fence_action(conn, options, set_power_status, get_power_status) if __name__ == "__main__": main() diff --git a/fence/agents/lib/Makefile b/fence/agents/lib/Makefile index f823b1d..00666fa 100644 --- a/fence/agents/lib/Makefile +++ b/fence/agents/lib/Makefile @@ -1,6 +1,6 @@ include ../../../make/defines.mk -TARGET= fencing.py +TARGET= fencing.py telnet_ssl FENCEAGENTSLIB= $(TARGET) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 226d2fd..2fe714b 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -27,6 +27,7 @@ EC_WAITING_OFF = 7 TELNET_PATH = "/usr/bin/telnet" SSH_PATH = "/usr/bin/ssh" +SSL_PATH = "@FENCEAGENTSLIBDIR@/telnet_ssl" all_opt = { "help" : { @@ -101,6 +102,10 @@ all_opt = { "getopt" : "x", "help" : "-x Use ssh connection", "order" : 1 }, + "ssl" : { + "getopt" : "z", + "help" : "-z Use ssl connection", + "order" : 1 }, "port" : { "getopt" : "n:", "help" : "-n Physical plug number on device", @@ -342,7 +347,10 @@ def fence_login(options): re_login = re.compile("(login: )|(Login Name: )|(username: )|(User Name :)", re.IGNORECASE) re_pass = re.compile("password", re.IGNORECASE) - if options.has_key("-x") and 0 == options.has_key("-k"): + if options.has_key("-z"): + command = '%s %s %s' % (SSL_PATH, options["-a"], "443") + conn = fspawn(command) + elif options.has_key("-x") and 0 == options.has_key("-k"): command = '%s %s@%s' % (SSH_PATH, options["-l"], options["-a"]) if options.has_key("ssh_options"): command += ' ' + options["ssh_options"] diff --git a/fence/agents/lib/telnet_ssl.py b/fence/agents/lib/telnet_ssl.py new file mode 100644 index 0000000..8c0c008 --- /dev/null +++ b/fence/agents/lib/telnet_ssl.py @@ -0,0 +1,66 @@ +#!/usr/bin/python + +##### +## simple telnet client with SSL support +## +## ./telnet_ssl.py host port +##### + +import sys, socket, string, fcntl, os , time +from OpenSSL import SSL + +def main(): + hostname = None + port = None + + if (len(sys.argv) != 3): + print "Error: You have to enter hostname and port number\n" + sys.exit(-1) + + hostname = sys.argv[1] + port = int(sys.argv[2]) + + try: + s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) + s.connect((hostname,port)) + ctx = SSL.Context(SSL.SSLv23_METHOD) + conn = SSL.Connection(ctx, s) + conn.set_connect_state() + except socket.error, e: + print "Error: Unable to connect to %s:%s %s" % (hostname, port, str(e)) + sys.exit(-1) + + fcntl.fcntl(sys.stdin, fcntl.F_SETFL, os.O_NONBLOCK) + s.settimeout(0) + + while 1: + try: + write_buff = sys.stdin.readline() + if (len(write_buff) > 0): + write_buff = string.rstrip(write_buff) + i = 10 + while i > 0: + i = i-1 + try: + conn.send(write_buff + "\r\n") + i = -1 + except SSL.WantReadError: + ## We have to wait for connect, mostly just for first time + time.sleep(1) + if i == 0: + sys.exit(-2) + except IOError: + 1 + + try: + read_buff = conn.recv(4096) + print read_buff + sys.stdout.flush() + except SSL.WantReadError: + 1 + except SSL.ZeroReturnError: + break + + +if __name__ == "__main__": + main() diff --git a/gfs2/edit/hexedit.c b/gfs2/edit/hexedit.c index fd59527..fa65000 100644 --- a/gfs2/edit/hexedit.c +++ b/gfs2/edit/hexedit.c @@ -27,8 +27,6 @@ #include "libgfs2.h" #include "gfs2hex.h" -#include - #define RGLIST_DUMMY_BLOCK -2 int display(int identify_only); diff --git a/make/defines.mk.input b/make/defines.mk.input index 1094012..a4fa193 100644 --- a/make/defines.mk.input +++ b/make/defines.mk.input @@ -4,6 +4,7 @@ initddir ?= ${DESTDIR}@INITDDIR@ libdir ?= ${DESTDIR}@LIBDIR@ libexecdir ?= ${DESTDIR}@LIBEXECDIR@ sharedir ?= ${DESTDIR}@SHAREDIR@ +docdir ?= ${DESTDIR}@DOCDIR@ mandir ?= ${DESTDIR}@MANDIR@ module_dir ?= @MODULE_DIR@ incdir ?= ${DESTDIR}@INCDIR@ hooks/post-receive -- Cluster Project