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

[Cluster-devel] Cluster Project branch, master, updated. gfs-kernel_0_1_22-213-g7f89ce5



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=7f89ce5ebb78316b621a34704da7a986839b68f4

The branch, master has been updated
       via  7f89ce5ebb78316b621a34704da7a986839b68f4 (commit)
      from  1ebf7d47b116d29c1d92e93478baffb97a86b019 (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 7f89ce5ebb78316b621a34704da7a986839b68f4
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Fri Apr 25 13:54:38 2008 +0200

    [FENCE] Enable new fence agents by default
    
    Remove enable_fence_experimental_agents configure option in favour of
    "crack_of_the_day"
    
    Rename files around as agreed with Marek.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

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

Summary of changes:
 configure                                      |    8 -
 fence/agents/apc/Makefile                      |    4 -
 fence/agents/apc/apc.py                        |  100 ---
 fence/agents/apc/fence_apc.py                  |  899 +++---------------------
 fence/agents/bladecenter/Makefile              |    4 -
 fence/agents/bladecenter/bladecenter.py        |   90 ---
 fence/agents/bladecenter/fence_bladecenter.pl  |  402 +++---------
 fence/agents/drac/Makefile                     |    6 +-
 fence/agents/drac/{drac5.py => fence_drac5.py} |    0 
 fence/agents/ilo/Makefile                      |    4 -
 fence/agents/ilo/fence_ilo.pl                  |  655 -----------------
 fence/agents/ilo/{ilo.py => fence_ilo.py}      |    0 
 fence/agents/lib/Makefile                      |    4 -
 fence/agents/wti/Makefile                      |    4 -
 fence/agents/wti/fence_wti.pl                  |  384 ----------
 fence/agents/wti/{wti.py => fence_wti.py}      |    0 
 make/defines.mk.input                          |    1 -
 17 files changed, 168 insertions(+), 2397 deletions(-)
 delete mode 100755 fence/agents/apc/apc.py
 mode change 100644 => 100755 fence/agents/apc/fence_apc.py
 delete mode 100755 fence/agents/bladecenter/bladecenter.py
 rename fence/agents/drac/{drac5.py => fence_drac5.py} (100%)
 delete mode 100755 fence/agents/ilo/fence_ilo.pl
 rename fence/agents/ilo/{ilo.py => fence_ilo.py} (100%)
 delete mode 100755 fence/agents/wti/fence_wti.pl
 rename fence/agents/wti/{wti.py => fence_wti.py} (100%)

diff --git a/configure b/configure
index 292215c..896eeff 100755
--- a/configure
+++ b/configure
@@ -88,7 +88,6 @@ my %options = (
 	conffile => \$conffile,
 	fence_agents => \$fence_agents,
 	fenceagentslibdir => \$fenceagentslibdir,
-	enable_experimental_fence_agents => \$enable_experimental_fence_agents,
 	enable_crack_of_the_day => \$enable_crack_of_the_day,
 	enable_xen => \$enable_xen,
 	somajor => \$somajor,
@@ -167,7 +166,6 @@ my $err = &GetOptions (\%options,
 		    'release_version=s',
 		    'fence_agents=s',
 		    'fenceagentslibdir=s',
-		    'enable_experimental_fence_agents',
 		    'enable_crack_of_the_day',
 		    'enable_xen',
 		    'without_ccs',
@@ -249,7 +247,6 @@ if ($help || !$err) {
   print "--fence_agents=\tlist of fence agents to configure.  (Default: all)\n";
   print "\t\tUse --fence_agents=help for a list\n";
   print "--fenceagentslibdir=\tspecify directory where to install common fence python lib.  (Default: /usr/lib/fence)\n";
-  print "--enable_experimental_fence_agents\tEnable build and install of experimental fence agents.  (Default: no)\n";
   print "--enable_crack_of_the_day\tEnable build of highly experimental features that rely on code that is not yet available for general use. (Default: no)\n";
   print "--enable_xen\tEnable building of Xen-specific pieces\n";
   print "--without_ccs\tDisable ccs building  (Default: enabled)\n";
@@ -538,9 +535,6 @@ if (!$fence_agents) {
 if (!$fenceagentslibdir) {
   $fenceagentslibdir="/usr/lib/fence";
 }
-if (!$enable_experimental_fence_agents) {
-  $enable_experimental_fence_agents="";
-}
 if (!$enable_crack_of_the_day) {
   $enable_crack_of_the_day="";
 } else {
@@ -548,7 +542,6 @@ if (!$enable_crack_of_the_day) {
   print "WARNING: *you* have explicitly enabled all possible experimental features under development!\n";
   print "         This code will have no mercy for your data and your machines. You have been warned!\n";
   print "\n********************************************************************************************\n";
-  $enable_experimental_fence_agents=1;
   $cflags="${cflags} -DEXPERIMENTAL_BUILD";
 }
 if (!$enable_xen) {
@@ -675,7 +668,6 @@ while (<IFILE>) {
   $_ =~ s/\ CONFFILE\@/$conffile/;
   $_ =~ s/\ FENCE_AGENTS\@/$fence_agents/;
   $_ =~ s/\ FENCEAGENTSLIBDIR\@/$fenceagentslibdir/;
-  $_ =~ s/\ ENABLE_EXPERIMENTAL_FENCE_AGENTS\@/$enable_experimental_fence_agents/;
   $_ =~ s/\ ENABLE_CRACK_OF_THE_DAY\@/$enable_crack_of_the_day/;
   $_ =~ s/\ ENABLE_XEN\@/$enable_xen/;
   $_ =~ s/\ DISABLE_CCS\@/$without_ccs/;
diff --git a/fence/agents/apc/Makefile b/fence/agents/apc/Makefile
index 6d25dfe..0299a61 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/apc/Makefile
@@ -15,8 +15,4 @@ include ../../../make/defines.mk
 
 TARGET= fence_apc
 
-ifdef enable_experimental_fence_agents
-TARGET += apc
-endif
-
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/apc/apc.py b/fence/agents/apc/apc.py
deleted file mode 100755
index 59c5083..0000000
--- a/fence/agents/apc/apc.py
+++ /dev/null
@@ -1,100 +0,0 @@
-#!/usr/bin/python
-
-##
-## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
-##
-## The Following Agent Has Been Tested On:
-##
-##  Model       Firmware
-## +---------------------------------------------+
-##  AP7951	AOS v2.7.0, PDU APP v2.7.3
-##
-## @note: ssh is very slow on AP7951 device
-#####
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New APC Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	result = ""
-	try:
-		conn.send("1\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-		conn.send("2\r\n")
-		while 1 == conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], SHELL_TIMEOUT):
-			result += conn.before
-			conn.send("\r\n")
-		result += conn.before
-		conn.send(chr(03))		
-		conn.log_expect(options, "- Logout", SHELL_TIMEOUT)
-		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("\s*"+options["-n"]+"-.*(ON|OFF)", re.IGNORECASE).search(result).group(1)
-	return status.lower().strip()
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "1",
-		'off': "2"
-	}[options["-o"]]
-
-	try:
-		conn.send("1\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-		conn.send("2\r\n")
-		while 1 == conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], SHELL_TIMEOUT):
-			conn.send("\r\n")
-		conn.send(options["-n"]+"\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-		conn.send(action+"\r\n")
-		conn.log_expect(options, "Enter 'YES' to continue or <ENTER> to cancel :", SHELL_TIMEOUT)
-		conn.send("YES\r\n")
-		conn.log_expect(options, "Press <ENTER> to continue...", SHELL_TIMEOUT)
-		conn.send("\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-		conn.send(chr(03))
-		conn.log_expect(options, "- Logout", SHELL_TIMEOUT)
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-	except pexcept.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexcept.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"secure", "port", "test" ]
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = "\n>"
-
-	##
-	## Operate the fencing device
-	####
-	conn = fence_login(options)
-	fence_action(conn, options, set_power_status, get_power_status)
-
-	##
-	## Logout from system
-	######
-	conn.sendline("4")
-	conn.close()
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/apc/fence_apc.py b/fence/agents/apc/fence_apc.py
old mode 100644
new mode 100755
index 90b2c30..59c5083
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -1,829 +1,100 @@
 #!/usr/bin/python
 
-###############################################################################
-###############################################################################
 ##
-##  Copyright (C) 2006 Red Hat, Inc.  All rights reserved.
+## Copyright (C) 2008 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.
+## The Following Agent Has Been Tested On:
 ##
-###############################################################################
-###############################################################################
-
-import getopt, sys
-import os
-import socket
-import time
-
-from telnetlib import Telnet
-
-TELNET_TIMEOUT=5  #How long to wait for a response from a telnet try
+##  Model       Firmware
+## +---------------------------------------------+
+##  AP7951	AOS v2.7.0, PDU APP v2.7.3
+##
+## @note: ssh is very slow on AP7951 device
+#####
 
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
+import sys, re, pexpect
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
 
 #BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New APC Agent - test release"
+RELEASE_VERSION="New APC Agent - test release on steroids"
 REDHAT_COPYRIGHT=""
-BUILD_DATE="September 21, 2006"
+BUILD_DATE="March, 2008"
 #END_VERSION_GENERATION
 
-POWER_OFF = 0
-POWER_ON = 1
-POWER_STATUS = 2
-POWER_REBOOT = 3
-
-COMPLETE = 0
-NOT_COMPLETE = 1
-
-ON = "ON"
-OFF = "OFF"
-
-SUCCESS = "success"
-FAIL = "fail"
-
-address = ""
-login = ""
-passwd = ""
-passwd_script = ""
-port = ""
-switchnum = ""
-action = POWER_REBOOT   #default action
-verbose = False
-
-logfile = None
-
-#set up regex list
-CONTROL_CONSOLE = "Control Console -----"
-DEVICE_MANAGER = "Device Manager -----"
-OUTLET_CONTROL = "- Outlet Control/Configuration -----"
-OUTLET_MANAGE = "- Outlet Management -----"
-CONTROL_OUTLET = "- Control Outlet -----"
-CONTROL_OUTLET_2 = "- Outlet Control "
-COMMAND_SUCCESS = "Command successfully issued."
-COMMAND_SUCCESS_2 = " Success"
-CONFIRM = "Enter 'YES' to continue or <ENTER> to cancel :"
-CONTINUE = "Press <ENTER> to continue..."
-SCREEN_END = "<ESC>- Main Menu, <ENTER>- Refresh, <CTRL-L>- Event Log"
-SCREEN_END_2 = "<ESC>- Back, <ENTER>- Refresh, <CTRL-L>- Event Log"
-USERNAME = "User Name :"
-PASSWORD = "Password  :"
-MASTER = "------- MasterSwitch"
-FIRMWARE_STR = "Rack PDU APP"
-
-CONTINUE_INDEX = 0
-
-FIRMWARE_REV = 2
-
-regex_list = list()
-regex_list.append(CONTINUE)
-regex_list.append(SCREEN_END)
-regex_list.append(SCREEN_END_2)
-regex_list.append(USERNAME)
-regex_list.append(PASSWORD)
-
-def usage():
-  print "Usage:\n"
-  print "fence_apc [options]"
-  print "Options:"
-  print "   -a <ipaddress>           ip or hostname of APC switch"
-  print "   -h                       print out help"
-  print "   -l [login]               login name"
-  print "   -n [port]                switch port"
-  print "   -p [password]            password"
-  print "   -S [path]                script to run to retrieve password"
-  print "   -o [action]              Reboot (default), Off, On, or Status"
-  print "   -v Verbose               Verbose mode - writes file to /tmp/apclog"
-  print "   -V                       Print Version, then exit"
-
-  sys.exit (0)
-
-def version():
-  print "fence_apc %s  %s\n" % (RELEASE_VERSION, BUILD_DATE)
-  print "%s\n" % REDHAT_COPYRIGHT
-  sys.exit(0)
+def get_power_status(conn, options):
+	result = ""
+	try:
+		conn.send("1\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+		conn.send("2\r\n")
+		while 1 == conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], SHELL_TIMEOUT):
+			result += conn.before
+			conn.send("\r\n")
+		result += conn.before
+		conn.send(chr(03))		
+		conn.log_expect(options, "- Logout", SHELL_TIMEOUT)
+		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("\s*"+options["-n"]+"-.*(ON|OFF)", re.IGNORECASE).search(result).group(1)
+	return status.lower().strip()
+
+def set_power_status(conn, options):
+	action = {
+		'on' : "1",
+		'off': "2"
+	}[options["-o"]]
+
+	try:
+		conn.send("1\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+		conn.send("2\r\n")
+		while 1 == conn.log_expect(options, [ options["-c"],  "Press <ENTER>" ], SHELL_TIMEOUT):
+			conn.send("\r\n")
+		conn.send(options["-n"]+"\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+		conn.send(action+"\r\n")
+		conn.log_expect(options, "Enter 'YES' to continue or <ENTER> to cancel :", SHELL_TIMEOUT)
+		conn.send("YES\r\n")
+		conn.log_expect(options, "Press <ENTER> to continue...", SHELL_TIMEOUT)
+		conn.send("\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+		conn.send(chr(03))
+		conn.log_expect(options, "- Logout", SHELL_TIMEOUT)
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+	except pexcept.EOF:
+		fail(EC_CONNECTION_LOST)
+	except pexcept.TIMEOUT:
+		fail(EC_TIMED_OUT)
 
 def main():
-
-  global address, login, passwd, passwd_script, port, action, verbose, logfile, switchnum
-
-  if len(sys.argv) > 1:
-    try:
-      opts, args = getopt.getopt(sys.argv[1:], "a:hl:o:n:p:S:vV", ["help", "output="])
-    except getopt.GetoptError:
-      #print help info and quit
-      usage()
-      sys.exit(2)
-      
-    for o, a in opts:
-      if o == "-v":
-        verbose = True
-      if o == "-V":
-        version()
-      if o in ("-h", "--help"):
-        usage()
-        sys.exit()
-      if o == "-l":
-        login = a
-      if o == "-p":
-        passwd = a
-      if o == "-S":
-        passwd_script = a
-      if o == "-n":
-        dex = a.find(":")
-        if dex == (-1):
-          port = a
-        else:
-          switchnum = a[:dex]
-          port = a[(dex+1):]
-      if o  == "-o":
-        if a == "Off" or a == "OFF" or a == "off":
-          action = POWER_OFF
-        elif a == "On" or a == "ON" or a == "on":
-          action = POWER_ON
-        elif a == "Status" or a == "STATUS" or a == "status":
-          action = POWER_STATUS
-        elif a == "Reboot" or a == "REBOOT" or a == "reboot":
-          action = POWER_REBOOT
-        else:
-          usage()
-          sys.exit()
-      if o == "-a":
-        address = a
-    if address == "" or login == "" or (passwd == "" and passwd_script == "") or port == "":
-      usage()
-      sys.exit()
-    
-  else: #Take args from stdin...
-    params = {}
-    #place params in dict
-    for line in sys.stdin:
-      val = line.split("=")
-      if len(val) == 2:
-        params[val[0].strip()] = val[1].strip()
-
-    try:
-      address = params["ipaddr"]
-    except KeyError, e:
-      sys.stderr.write("FENCE: Missing ipaddr param for fence_apc...exiting")
-      sys.exit(1)
-    try:
-      login = params["login"]
-    except KeyError, e:
-      sys.stderr.write("FENCE: Missing login param for fence_apc...exiting")
-      sys.exit(1)
-    try:
-      if 'passwd' in params:
-        passwd = params["passwd"]
-      if 'passwd_script' in params:
-        passwd_script = params['passwd_script']
-      if passwd == "" and passwd_script == "":
-        raise "missing password"
-    except:
-      sys.stderr.write("FENCE: Missing passwd for fence_apc...exiting")
-      sys.exit(1)
-    try:
-      port = params["port"]
-    except KeyError, e:
-      sys.stderr.write("FENCE: Missing port param for fence_apc...exiting")
-      sys.exit(1)
-    try:
-      switchnum = params["switch"]
-    except KeyError, e:
-      pass
-    try:
-      verbose = params["verbose"]
-      verbose = (verbose == 'True' or verbose == 'true' or verbose == 'TRUE')
-    except KeyError, e:
-      pass
-    
-    try:
-      a = params["option"]
-      if a == "Off" or a == "OFF" or a == "off":
-        action = POWER_OFF
-      elif a == "On" or a == "ON" or a == "on":
-        action = POWER_ON
-      elif a == "Reboot" or a == "REBOOT" or a == "reboot":
-        action = POWER_REBOOT
-    except KeyError, e:
-      action = POWER_REBOOT
-    
-    #### End of stdin section
-  
-  
-  # retrieve passwd from passwd_script (if specified)
-  passwd_scr = ''
-  if len(passwd_script):
-    try:
-      if not os.access(passwd_script, os.X_OK):
-        raise 'script not executable'
-      p = os.popen(passwd_script, 'r', 1024)
-      passwd_scr = p.readline().strip()
-      if p.close() != None:
-        raise 'script failed'
-    except:
-      sys.stderr.write('password-script "%s" failed\n' % passwd_script)
-      passwd_scr = ''
-    
-  if passwd == "" and passwd_scr == "":
-    sys.stderr.write('password not available, exiting...')
-    sys.exit(1)
-  elif passwd == passwd_scr:
-    pass
-  elif passwd and passwd_scr:
-    # execute self, with password_scr as passwd,
-    # if that fails, continue with "passwd" argument as password
-    if len(sys.argv) > 1:
-      comm = sys.argv[0]
-      skip_next = False
-      for w in sys.argv[1:]:
-        if skip_next:
-          skip_next = False
-        elif w in ['-p', '-S']:
-          skip_next = True
-        else:
-          comm += ' ' + w
-      comm += ' -p ' + passwd_scr
-      ret = os.system(comm)
-      if ret != -1 and os.WIFEXITED(ret) and os.WEXITSTATUS(ret) == 0:
-        # success
-        sys.exit(0)
-      else:
-        sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
-    else: # use stdin
-      p = os.popen(sys.argv[0], 'w', 1024)
-      for par in params:
-        if par not in ['passwd', 'passwd_script']:
-          p.write(par + '=' + params[par] + '\n')
-      p.write('passwd=' + passwd_scr + '\n')
-      p.flush()
-      if p.close() == None:
-        # success
-        sys.exit(0)
-      else:
-        sys.stderr.write('Use of password from "passwd_script" failed, trying "passwd" argument\n')
-  elif passwd_scr:
-    passwd = passwd_scr
-  # passwd all set
-  
-  
-  
-  ### Order of events
-  # 0) If verbose, prepare log file handle
-  # 1) Open socket
-  # 2) Log in
-  # 3) Evaluate task. Task will be one of:
-  # 3a - Check status and print to stdout (or log file if verbose)
-  # 3b - Turn a port off, then confirm
-  # 3c - Turn a port on, then confirm
-  # 3d - Reboot by turning a port off, then on, and confirming each step.
-
-  if verbose:
-    setup_logging()
-
-  sock = setup_socket()
-
-  # Ok, now lets log in...
-  do_login(sock)
-
-  # Now we should be at the outside Control screen
-    
-  if action == POWER_STATUS:
-    # We should be at the Control screen, so we need to write a '1'
-    # to kick things off
-    sock.write("1\r")
-    statusval = do_status_check(sock)
-    backout(sock)
-    sock.write("4\r")  # Logs out
-    
-  elif action == POWER_OFF:
-    sock.write("1\r")
-    do_power_off(sock)
-    backout(sock) # Return to control screen
-    statusval = do_status_check(sock)
-    if statusval == OFF:
-      if verbose:
-        logit("Power Off successful\n")
-      print "Power Off successful"
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(0)
-    else:
-      if verbose:
-        logit("Power Off unsuccessful\n")
-        logit("Undetermined error\n")
-      sys.stderr.write("Power Off unsuccessful")
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(1)
-    
-  elif action == POWER_ON:
-    sock.write("1\r")
-    do_power_on(sock)
-    backout(sock) # Return to control screen
-    statusval = do_status_check(sock)
-    if statusval == ON:
-      if verbose:
-        logit("Power On successful\n")
-      print "Power On successful"
-      backout(sock)
-      sock.write("4\r")  # logs out
-      sock.close()
-      sys.exit(0)
-    else:
-      if verbose:
-        logit("Power On unsuccessful\n")
-        logit("Undetermined error\n")
-      sys.stderr.write("Power On unsuccessful")
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(1)
-
-  elif action == POWER_REBOOT:
-    sock.write("1\r")
-    do_power_off(sock)
-    backout(sock) # Return to control screen
-    statusval = do_status_check(sock)
-    if statusval == OFF:
-      if verbose:
-        logit("Power Off successful\n")
-      print "Power Off successful"
-      backout(sock)
-    else:
-      if verbose:
-        logit("Power Off unsuccessful\n")
-        logit("Undetermined error\n")
-      sys.stderr.write("Power Off unsuccessful")
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(1)
-    do_power_on(sock)
-    backout(sock) # Return to control screen
-    statusval = do_status_check(sock)
-    if statusval == ON:
-      if verbose:
-        logit("Power Reboot successful\n")
-      print "Power Reboot successful"
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(0)
-    else:
-      if verbose:
-        logit("Power Reboot unsuccessful\n")
-        logit("Undetermined error\n")
-      sys.stderr.write("Power Reboot unsuccessful")
-      backout(sock)
-      sock.write("4\r")  # Logs out
-      sock.close()
-      sys.exit(1)
-    
-  sock.close()
-
-def backout(sock):
-  sock.write(chr(27))
-  
-  while (1):
-    i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
-
-    if regex_list[i] == SCREEN_END:
-      break
-    elif regex_list[i] == SCREEN_END_2:
-      sock.write(chr(27))
-
-def setup_socket():
-  ## Time to open telnet session and log in. 
-  try:
-    sock = Telnet(address.strip())
-  except socket.error, (errno, msg):
-    my_msg = "FENCE: A problem was encountered opening a telnet session with " + address
-    if verbose:
-      logit(my_msg)
-      logit("FENCE: Error number: %d -- Message: %s\n" % (errno, msg))
-      logit("Firewall issue? Correct address?\n")
-
-    sys.stderr.write(my_msg)
-    sys.stderr.write(("FENCE: Error number: %d -- Message: %s\n" % (errno, msg)))
-    sys.stderr.write("Firewall issue? Correct address?\n")
-    sys.exit(1)
-
-  if verbose:
-    logit("\nsocket open to %s\n" % address)
-
-  return sock
-
-def setup_logging( log_location="/tmp/apclog"):
-  global logfile
-  try:
-    logfile = open(log_location, 'a')
-    logfile.write("###############################################\n")
-    logfile.write("Telnetting to apc switch %s\n" % address)
-    now = time.localtime(time.time())
-    logfile.write(time.asctime(now))
-  except IOError, e:
-    sys.stderr.write("Failed to open log file %s" % log_location)
-    logfile = None
-
-def logit(instr):
-  if logfile != None:
-    logfile.write(instr)
-
-def do_login(sock):
-  result_code = 1
-
-  ## This loop tries to assemble complete telnet screens and passes
-  ## them to helper methods to handle responses accordingly.
-  while result_code:
-    try:
-      i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
-    except socket.error, (errno, msg):
-      my_msg = "FENCE: A problem was encountered opening a telnet session with " + address + "\n"
-      if verbose:
-        logit(my_msg)
-        logit("FENCE: Error number: %d -- Message: %s\n" % (errno, msg))
-
-      sys.stderr.write(my_msg)
-      sys.stderr.write(("FENCE: Error number: %d -- Message: %s\n" % (errno, msg)))
-      sys.exit(1)
-
-    if i == CONTINUE_INDEX: # Capture the rest of the screen...
-      sock.write("\r")
-      ii,moo,txtt = sock.expect(regex_list, TELNET_TIMEOUT)
-      txt = txt + txtt
-
-    ndbuf = sock.read_eager() # Scoop up remainder
-    if verbose:
-      logit(txt + ndbuf)
-    result_code,response = log_in(txt + ndbuf)
-    if result_code:
-      try:
-        sock.write(response)
-      except socket.error, (errno, msg):
-        if verbose:
-          logit("Error #%s" % errno)
-          logit(msg)
-        sys.stderr.write("Error #%s:  %s" % (errno,msg))
-        sys.exit(1)
-
-def log_in(buffer):
-  global FIRMWARE_REV
-  lines = buffer.splitlines()
-
-  for i in lines:
-    if i.find(USERNAME) != (-1):
-      if verbose:
-        logit("Sending login: %s\n" % login)
-      return (NOT_COMPLETE, login + "\r")
-    elif i.find(PASSWORD) != (-1):
-      if verbose:
-        logit("Sending password: %s\n" % passwd)
-      return (NOT_COMPLETE, passwd + "\r")
-    elif i.find(CONTROL_CONSOLE) != (-1):
-      #while we are here, grab the firmware revision
-      rev_search_lines = buffer.splitlines()
-      for rev_search_line in rev_search_lines: #search screen again
-        rev_dex = rev_search_line.find(FIRMWARE_STR)
-        if rev_dex != (-1): #found revision line
-          scratch_rev = rev_search_line[rev_dex:]
-          v_dex = scratch_rev.find("v")
-          if v_dex != (-1):
-            if scratch_rev[v_dex + 1] == "3": #format is v3.3.4
-              FIRMWARE_REV = 3
-              break
-      return (COMPLETE, "1\r") 
-
-def do_status_check(sock):
-  result_code = 1
-  while result_code:
-    i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
-    if i == CONTINUE_INDEX: # Capture the rest of the screen...
-      sock.write("\r")
-      ii,moo,txtt = sock.expect(regex_list, TELNET_TIMEOUT)
-      txt = txt + txtt
-
-    ndbuf = sock.read_eager() # Scoop up remainder
-    if verbose:
-      logit(txt + ndbuf)
-    (result_code,response,statusval) = return_status(txt + ndbuf)
-    if result_code:
-      try:
-        sock.write(response)
-      except socket.error, (errno, msg):
-        if verbose:
-          logit("Status check failed.")
-          logit("Error #%s" % errno)
-          logit(msg)
-        sys.stderr.write("Status check failed.")
-        sys.stderr.write("Error #%s:  %s" % (errno,msg))
-        sys.exit(1)
-  # Back from status check - value should be in status var
-  if response == SUCCESS:
-    if switchnum == "":
-      if verbose:
-        logit("Status check successful. Port %s is %s" % (port,statusval))
-      print "Status check successful. Port %s is %s" % (port,statusval)
-    else:
-      if verbose:
-        logit("Status check successful. Port %s:%s is %s" % (switchnum, port, statusval))
-      print "Status check successful. Port %s:%s is %s" % (switchnum, port, statusval)
-
-    return statusval
-  else:
-    if verbose:
-      logit("Status check failed, unknown reason.")
-    sys.stderr.write("Status check failed, unknown reason.\n")
-    sock.close()
-    sys.exit(1) 
-
-def return_status(buffer):
-  global switchnum, port
-
-  lines = buffer.splitlines()
-
-  for i in lines:
-    if i.find(CONTROL_CONSOLE) != (-1):
-      return (NOT_COMPLETE, "1\r", "Status Unknown")
-    elif i.find(DEVICE_MANAGER) != (-1):
-      if switchnum != "":
-        res = switchnum + "\r"
-      else:
-        if FIRMWARE_REV == 2:
-          res = "3\r"
-        elif FIRMWARE_REV == 3:
-          res = "2\r1\r"
-        else: #placeholder for future revisions 
-          res = "3\r"
-      return (NOT_COMPLETE, res, "Status Unknown")
-    elif i.find(OUTLET_CONTROL) != (-1):
-      ls = buffer.splitlines()
-      portval = port.strip()
-      portval = " " + portval + " "
-      portval2 = " " + port.strip() + "- "
-      found_portval = False
-      for l in ls:
-        if l.find(portval) != (-1) or l.find(portval2) != (-1):
-          found_portval = True
-          linesplit = l.split()
-          linelen = len(linesplit)
-          return (COMPLETE,SUCCESS,linesplit[linelen - 1])
-    elif i.find(MASTER) != (-1):
-      try:
-        e = int(port.strip())
-        portval = port.strip()
-        switchval = switchnum.strip()
-        portval = switchval + ":" + portval
-      except ValueError, e:
-        portval = port.strip()
-      ls = buffer.splitlines()
-      found_portval = False
-      for l in ls:
-        words = l.split()
-        if len(words) > 3:
-          if words[2] == portval or words[3] == portval:
-            found_portval = True
-            linesplit = l.split()
-            linelen = len(linesplit)
-            return (COMPLETE, SUCCESS, linesplit[linelen - 3])
-      return (COMPLETE, FAIL, "Incorrect port number")
-  return (NOT_COMPLETE, chr(27), "Status Unknown")
-
-def do_power_switch(sock, status):
-  result_code = 1
-
-  while result_code:
-    i, mo, txt = sock.expect(regex_list, TELNET_TIMEOUT)
-    if i == CONTINUE_INDEX: # Capture the rest of the screen...
-      sock.write("\r")
-      ii,moo,txtt = sock.expect(regex_list, TELNET_TIMEOUT)
-      txt = txt + txtt
-
-    ndbuf = sock.read_eager() # Scoop up remainder
-    if verbose:
-      logit(txt + ndbuf)
-
-    if status == "off":
-      result_code, response = power_off(txt + ndbuf)
-    elif status == "on":
-      result_code, response = power_on(txt + ndbuf)
-    else:
-      if verbose:
-        logit("Invalid status in do_power_switch() function")
-      sys.stderr.write("Invalid status in do_power_switch() function") 
-      sys.exit(1)
-
-    if result_code:
-      try:
-        sock.write(response)
-      except socket.error, (errno, msg):
-        if verbose:
-          logit("Error #%s" % errno)
-          logit(msg)
-        sys.stderr.write("Error #%s:  %s" % (errno,msg))
-        sys.exit(1)
-      # FIXME: always returns COMPLETE (0)
-    else:
-      try:
-        sock.write(response)
-      except socket.error, (errno, msg):
-        if verbose:
-          logit("Error #%s" % errno)
-          logit(msg)
-        sys.stderr.write("Error #%s:  %s" % (errno,msg))
-        sys.exit(1)
-      return COMPLETE
-
-
-def power_switch(buffer, escape, control_outlet, control_outlet2):
-  # If port is not aliased, then outlet control screen will have the word
-  # 'Outlet' in the header. If the name is aliased, it will only have the 
-  # alias in the header.
-
-  outlet_search_str1 = "Outlet " + port.strip() + " ------------"
-  outlet_search_str2 = port.strip() + " ------------"
-  outlet_search_str3 = "Outlet " + switchnum.strip() + ":" + port.strip() + " ------"
-  outlet_search_str4 = "        Outlet       : " + port.strip()
-  outlet_search_str5 = "        Outlet Name : " + port.strip()
-  master_search_str1 = "-------- Master"
-  lines = buffer.splitlines()
-
-  for i in lines:
-    if i.find(CONTROL_CONSOLE) != (-1):
-      return (NOT_COMPLETE,"1\r")
-
-    elif i.find(DEVICE_MANAGER) != (-1):
-      if switchnum != "":
-        res = switchnum + "\r"
-      else:
-        if FIRMWARE_REV == 2:
-          res = "3\r"
-        elif FIRMWARE_REV == 3:
-          res = "2\r1\r"
-        else: #placeholder for future revisions - sheesh
-          res = "3\r"
-      return (NOT_COMPLETE, res)
-      
-    elif (i.find(master_search_str1) != (-1)):
-      return (NOT_COMPLETE, port.strip() + "\r")
-      
-    elif i.find(outlet_search_str1) != (-1) and (switchnum == ""):
-      return (NOT_COMPLETE,"1\r")
-
-    elif i.find(outlet_search_str2) != (-1) and (switchnum == ""):
-      return (NOT_COMPLETE,"1\r")
-    
-    elif i.find(outlet_search_str3) != (-1):
-      return (NOT_COMPLETE, "1\r")
-    
-    elif i == outlet_search_str4:
-      return (NOT_COMPLETE, "1\r")
-    
-    elif i == outlet_search_str5:
-      return (NOT_COMPLETE, "1\r")
-    
-    elif i.find(OUTLET_MANAGE) != (-1):
-      #return (NOT_COMPLETE, "1\r")
-      return (NOT_COMPLETE, "\r")
-
-    #elif i.find(OUTLET_CONTROL) != (-1) or i.find(OUTLET_MANAGE) != (-1):
-    elif i.find(OUTLET_CONTROL) != (-1):
-      ls = buffer.splitlines()
-      portval = port.strip()
-      portval = " " + portval + " "
-      found_portval = False
-      i = 0
-      # look for aliased name 
-      for l in ls:
-        i = i + 1
-        if l.find(portval) != (-1):
-          found_portval = True
-          linesplit = l.split()
-          outlet_str = linesplit[0]
-          dex = outlet_str.find("-")
-          if dex <= (0):
-            if verbose:
-              logit("Problem identifying outlet\n")
-              logit("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.stderr.write("Problem identifying outlet\n")
-            sys.stderr.write("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.exit(1)
-          normalized_outlet_str = outlet_str[:dex]
-          return (NOT_COMPLETE, normalized_outlet_str + "\r")
-      # look for portnum
-      portval = " " + port.strip() + "-"
-      i = 0
-      for l in ls:
-        i = i + 1
-        if l.find(portval) != (-1):
-          found_portval = True
-          linesplit = l.split()
-          outlet_str = linesplit[0]
-          dex = outlet_str.find("-")
-          if dex <= (0):
-            if verbose:
-              logit("Problem identifying outlet\n")
-              logit("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.stderr.write("Problem identifying outlet\n")
-            sys.stderr.write("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.exit(1)
-          normalized_outlet_str = outlet_str[:dex]
-          return (NOT_COMPLETE, normalized_outlet_str + "\r")
-      if found_portval == False:
-        if verbose:
-          logit("Problem identifying outlet\n")
-          logit("Looking for '%s' in string '%s'\n" % (portval, ls))
-        sys.stderr.write("Problem identifying outlet\n")
-        sys.stderr.write("Looking for '%s' in string '%s'\n" % (portval, ls))
-        sys.exit(1)
-
-    elif i.find(MASTER) != (-1):
-      ls = buffer.splitlines()
-      found_portval = False
-      # look for aliased name
-      portval = port.strip()
-      for l in ls:
-        words = l.strip().split()
-        if len(words) > 3:
-          if '----' not in words[0] and words[3].strip() == portval:
-            outlet_str = words[0]
-            dex = outlet_str.find("-")
-            if dex <= (0):
-              if verbose:
-                logit("Problem identifying outlet\n")
-                logit("Looking for %s in string %s\n" % (portval, outlet_str))
-              sys.stderr.write("Problem identifying outlet\n")
-              sys.stderr.write("Looking for %s in string %s\n" % (portval, outlet_str))
-              sys.exit(1)
-            normalized_outlet_str = outlet_str[:dex]
-            return (NOT_COMPLETE, (normalized_outlet_str + "\r"))
-      # look for portnum
-      portval = port.strip()
-      portval = switchnum.strip() + ":" + portval + " "
-      i = 0
-      for l in ls:
-        i = i + 1
-        if l.find(portval) != (-1):
-          found_portval = True
-          linesplit = l.split()
-          outlet_str = linesplit[0]
-          dex = outlet_str.find("-")
-          if dex <= (0):
-            if verbose:
-              logit("Problem identifying outlet\n")
-              logit("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.stderr.write("Problem identifying outlet\n")
-            sys.stderr.write("Looking for %s in string %s\n" % (portval,outlet_str))
-            sys.exit(1)
-          normalized_outlet_str = outlet_str[:dex]
-          return (NOT_COMPLETE, (normalized_outlet_str + "\r"))
-      if found_portval == False:
-        if verbose:
-          logit("Problem identifying outlet\n")
-          logit("Looking for '%s' in string '%s'\n" % (portval, ls))
-        sys.stderr.write("Problem identifying outlet\n")
-        sys.stderr.write("Looking for '%s' in string '%s'\n" % (portval, ls))
-        sys.exit(1)
-
-    elif i.find(CONFIRM) != (-1):
-      return (NOT_COMPLETE,"YES\r")
-
-    elif i.find(COMMAND_SUCCESS) != (-1):
-      return (COMPLETE,"\r")
-
-    elif i.find(COMMAND_SUCCESS_2) != (-1):
-      return (COMPLETE,"\r")
-
-    elif i.find(CONTROL_OUTLET) != (-1):
-      return (NOT_COMPLETE, control_outlet + "\r")
-
-    elif i.find(CONTROL_OUTLET_2) != (-1):
-      return (NOT_COMPLETE, control_outlet2 + "\r")
-  
-  if (escape == True):
-    return (NOT_COMPLETE, chr(27))
-  else:
-    raise "unknown screen encountered in \n" + str(lines) + "\n"
-
-def do_power_off(sock):
-  x = do_power_switch(sock, "off")
-  return x
-
-def power_off(buffer):
-  x = power_switch(buffer, False, "2", "3");
-  return x
-
-def do_power_on(sock):
-  x = do_power_switch(sock, "on")
-  return x
-
-def power_on(buffer):
-  x = power_switch(buffer, True, "1", "1");
-  return x
+	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
+			"action", "ipaddr", "login", "passwd", "passwd_script",
+			"secure", "port", "test" ]
+
+	options = check_input(device_opt, process_input(device_opt))
+
+	## 
+	## Fence agent specific defaults
+	#####
+	if 0 == options.has_key("-c"):
+		options["-c"] = "\n>"
+
+	##
+	## Operate the fencing device
+	####
+	conn = fence_login(options)
+	fence_action(conn, options, set_power_status, get_power_status)
+
+	##
+	## Logout from system
+	######
+	conn.sendline("4")
+	conn.close()
 
 if __name__ == "__main__":
-  main()
+	main()
diff --git a/fence/agents/bladecenter/Makefile b/fence/agents/bladecenter/Makefile
index 98c54a0..e0700c8 100644
--- a/fence/agents/bladecenter/Makefile
+++ b/fence/agents/bladecenter/Makefile
@@ -15,8 +15,4 @@ include ../../../make/defines.mk
 
 TARGET= fence_bladecenter
 
-ifdef enable_experimental_fence_agents
-TARGET += bladecenter
-endif
-
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/bladecenter/bladecenter.py b/fence/agents/bladecenter/bladecenter.py
deleted file mode 100755
index e049735..0000000
--- a/fence/agents/bladecenter/bladecenter.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/python
-
-##
-## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
-##
-## The Following Agent Has Been Tested On:
-##
-##  Model                 Firmware
-## +--------------------+---------------------------+
-## (1) Main application	  BRET85K, rev 16  
-##     Boot ROM           BRBR67D, rev 16
-##     Remote Control     BRRG67D, rev 16
-##
-#####
-
-import sys, re, pexpect
-sys.path.append("@FENCEAGENTSLIBDIR@")
-from fencing import *
-
-#BEGIN_VERSION_GENERATION
-RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
-REDHAT_COPYRIGHT=""
-BUILD_DATE="March, 2008"
-#END_VERSION_GENERATION
-
-def get_power_status(conn, options):
-	try:
-		node_cmd = "system:blade\[" + options["-n"] + "\]>"
-
-		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
-		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
-		conn.send("power -state\r\n")
-		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
-		status = conn.before.splitlines()[-1]
-		conn.send("env -T system\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-	except pexpect.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexpect.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-	return status.lower().strip()
-
-def set_power_status(conn, options):
-	action = {
-		'on' : "powerup",
-		'off': "powerdown"
-	}[options["-o"]]
-
-	try:
-		node_cmd = "system:blade\[" + options["-n"] + "\]>"
-
-		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
-		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
-		conn.send("power -"+options["-o"]+"\r\n")
-		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
-		conn.send("env -T system\r\n")
-		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
-	except pexcept.EOF:
-		fail(EC_CONNECTION_LOST)
-	except pexcept.TIMEOUT:
-		fail(EC_TIMED_OUT)
-
-def main():
-	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
-			"action", "ipaddr", "login", "passwd", "passwd_script",
-			"cmd_prompt", "secure", "port" ]
-
-	options = check_input(device_opt, process_input(device_opt))
-
-	## 
-	## Fence agent specific defaults
-	#####
-	if 0 == options.has_key("-c"):
-		options["-c"] = "system>"
-
-	##
-	## Operate the fencing device
-	######
-	conn = fence_login(options)
-	fence_action(conn, options, set_power_status, get_power_status)
-
-	##
-	## Logout from system
-	######
-	conn.send("exit\r\n")
-	conn.close()
-
-if __name__ == "__main__":
-	main()
diff --git a/fence/agents/bladecenter/fence_bladecenter.pl b/fence/agents/bladecenter/fence_bladecenter.pl
index 13f81f8..e049735 100755
--- a/fence/agents/bladecenter/fence_bladecenter.pl
+++ b/fence/agents/bladecenter/fence_bladecenter.pl
@@ -1,328 +1,90 @@
-#!/usr/bin/perl
+#!/usr/bin/python
 
-###############################################################################
-###############################################################################
 ##
-##  Copyright (C) Sistina Software, Inc.  1997-2003  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
-##  of the GNU General Public License v.2.
+## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved.
 ##
-###############################################################################
-###############################################################################
-#
-# Tested against:
-# Firmware Type     Build ID   File Name     Released  Revision
-# ----------------  --------   ------------  --------  --------
-# Main application  BRET67D    CNETMNUS.PKT  07-22-04  16
-# Boot ROM          BRBR67D    CNETBRUS.PKT  07-22-04  16  	
-# Remote control    BRRG67D    CNETRGUS.PKT  07-22-04  16   	
-#
-use Getopt::Std;
-use Net::Telnet ();
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-$action = "reboot"; # Default fence action
+## The Following Agent Has Been Tested On:
+##
+##  Model                 Firmware
+## +--------------------+---------------------------+
+## (1) Main application	  BRET85K, rev 16  
+##     Boot ROM           BRBR67D, rev 16
+##     Remote Control     BRRG67D, rev 16
+##
+#####
 
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
+import sys, re, pexpect
+sys.path.append("@FENCEAGENTSLIBDIR@")
+from fencing import *
 
 #BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
+RELEASE_VERSION="New Bladecenter Agent - test release on steroids"
+REDHAT_COPYRIGHT=""
+BUILD_DATE="March, 2008"
 #END_VERSION_GENERATION
 
-
-sub usage
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -a <ip>          IP address or hostname of blade center\n";
-	print "  -h               usage\n";
-	print "  -l <name>        Login name\n";
-	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";
-
-	exit 0;
-}
-
-sub fail
-{
-	($msg) = @_;
-	print $msg."\n" unless defined $quiet;
-	$t->close if defined $t;
-	exit 1;
-}
-
-sub fail_usage
-{
-	($msg)= _;
-	print STDERR $msg."\n" if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-	exit 0;
-}
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-	
-		# skip comments
-		next if /^#/;
-
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{  
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		}
-	
-		# DO NOTHING -- this field is used by fenced
-		elsif ($name eq "agent" ) { } 
-
-		elsif ($name eq "ipaddr" ) 
-		{
-			$host = $val;
-		} 
-		elsif ($name eq "login" ) 
-		{
-			$login = $val;
-		} 
-		elsif ($name eq "option" )
-		{
-			$action = $val;
-		}
-		elsif ($name eq "passwd" ) 
-		{
-			$passwd = $val;
-		}
-		elsif ($name eq "passwd_script" ) {
-			$passwd_script = $val;
-		}
-		elsif ($name eq "blade" ) 
-		{
-			$bladenum = $val;
-		} 
-		elsif ($name eq "debuglog" ) 
-		{
-			$verbose = $val;
-		} 
-	}
-}
-
-sub get_power_state
-{
-	my ($junk) = @_;
-	fail "illegal argument to get_power_state()" if defined $junk;
-
-	my $state="";
-
-	$t->print("env -T system:blade[$bladenum]");
-	($text, $match) = $t->waitfor("/system:blade\\[$bladenum\\]>/");
-
-	$t->print("power -state");
-	($text, $match) = $t->waitfor("/system:blade\\[$bladenum\\]>/");
-
-	if ($text =~ /power -state\n(on|off)/im )
-	{
-		$state = $1;
-	}
-	else
-	{
-		fail "unexpected powerstate";
-	}
-
-	$t->print("env -T system");
-	($text, $match) = $t->waitfor("/system>/");
-
-	$_=$state;
-}
-
-sub set_power_state
-{
-	my ($set,$junk) = @_;
-	fail "missing argument to set_power_state()" unless defined $set;
-	fail "illegal argument to set_power_state()" if defined $junk;
-
-	my $state="";
-
-	$t->print("env -T system:blade[$bladenum]");
-	($text, $match) = $t->waitfor("/system:blade\\[$bladenum\\]>/");
-
-	$t->print("power -$set");
-	($text, $match) = $t->waitfor("/system:blade\\[$bladenum\\]>/");
-
-	fail "unexpected powerstate" unless ($text =~ /power -$set\nOK/im );
-
-	$t->print("env -T system");
-	($text, $match) = $t->waitfor("/system>/");
-
-	# need to sleep a few seconds to make sure that the bladecenter 
-	# has time to issue the power on/off command
-	sleep 5;
-
-	$_=$state;
-}
-
-# MAIN
-
-if (@ARGV > 0) 
-{
-	getopts("a:hl:n:o:p:S:qv:V") || fail_usage ;
-
-	usage if defined $opt_h;
-	version if defined $opt_V;
-
-	$host     = $opt_a if defined $opt_a;
-	$login    = $opt_l if defined $opt_l;
-	$passwd   = $opt_p if defined $opt_p;
-	$action   = $opt_o if defined $opt_o;
-	$bladenum = $opt_n if defined $opt_n;
-	$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' or '-S' flag specified." unless defined $passwd;
-	fail_usage "Unrecognised action '$action' for '-o' flag"
-		unless $action =~ /^(on|off|reboot|status)$/i;
-} 
-else 
-{
-	get_options_stdin();
-
-	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: 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 
-$_=$action;
-if    (/^on$/i)     { $action = "on"; }
-elsif (/^off$/i)    { $action = "off"; }
-elsif (/^reboot$/i) { $action = "reboot"; }
-elsif (/^status$/i) { $action = "status"; }
-
-#
-# Set up and log in
-#
-$t = new Net::Telnet;
-
-$t->input_log($verbose) if $verbose;
-$t->open($host);
-
-$t->waitfor('/username:/');
-$t->print($login);
-
-$t->waitfor('/password:/');
-$t->print($passwd);
-
-($text, $match) = $t->waitfor("/system>/");
-
-#
-# Do the command
-#
-$success=0;
-$_ = $action;
-if (/(on|off)/)
-{
-	set_power_state $action;
-	get_power_state;
-	$success = 1 if (/^$action$/i);
-}
-elsif (/reboot/)
-{
-	set_power_state off;
-	get_power_state;
-	
-	if (/^off$/i)
-	{
-		set_power_state on;
-		get_power_state;
-		$success = 1 if (/^on$/i);
-	}
-}
-elsif (/status/)
-{
-	get_power_state;
-	$state=$_;
-	$success = 1 if defined $state;
-}
-else
-{
-	fail "fail: illegal action";
-}
-
-$t->print("exit");
-sleep 1;
-$t->close();
-
-
-if ($success)
-{
-	print "success: blade$bladenum $action". ((defined $state) ? ": $state":"")
-		."\n" unless defined $quiet;
-	exit 0;
-}
-else
-{
-	fail "fail: blade$bladenum $action";	
-	exit 1
-}
+def get_power_status(conn, options):
+	try:
+		node_cmd = "system:blade\[" + options["-n"] + "\]>"
+
+		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
+		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
+		conn.send("power -state\r\n")
+		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
+		status = conn.before.splitlines()[-1]
+		conn.send("env -T system\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+	except pexpect.EOF:
+		fail(EC_CONNECTION_LOST)
+	except pexpect.TIMEOUT:
+		fail(EC_TIMED_OUT)
+
+	return status.lower().strip()
+
+def set_power_status(conn, options):
+	action = {
+		'on' : "powerup",
+		'off': "powerdown"
+	}[options["-o"]]
+
+	try:
+		node_cmd = "system:blade\[" + options["-n"] + "\]>"
+
+		conn.send("env -T system:blade[" + options["-n"] + "]\r\n")
+		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
+		conn.send("power -"+options["-o"]+"\r\n")
+		conn.log_expect(options, node_cmd, SHELL_TIMEOUT)
+		conn.send("env -T system\r\n")
+		conn.log_expect(options, options["-c"], SHELL_TIMEOUT)
+	except pexcept.EOF:
+		fail(EC_CONNECTION_LOST)
+	except pexcept.TIMEOUT:
+		fail(EC_TIMED_OUT)
+
+def main():
+	device_opt = [  "help", "version", "agent", "quiet", "verbose", "debug",
+			"action", "ipaddr", "login", "passwd", "passwd_script",
+			"cmd_prompt", "secure", "port" ]
+
+	options = check_input(device_opt, process_input(device_opt))
+
+	## 
+	## Fence agent specific defaults
+	#####
+	if 0 == options.has_key("-c"):
+		options["-c"] = "system>"
+
+	##
+	## Operate the fencing device
+	######
+	conn = fence_login(options)
+	fence_action(conn, options, set_power_status, get_power_status)
+
+	##
+	## Logout from system
+	######
+	conn.send("exit\r\n")
+	conn.close()
+
+if __name__ == "__main__":
+	main()
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
index f862d4b..e0267f3 100644
--- a/fence/agents/drac/Makefile
+++ b/fence/agents/drac/Makefile
@@ -13,10 +13,6 @@
 
 include ../../../make/defines.mk
 
-TARGET= fence_drac
-
-ifdef enable_experimental_fence_agents
-TARGET += drac5
-endif
+TARGET= fence_drac fence_drac5
 
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/drac/drac5.py b/fence/agents/drac/fence_drac5.py
similarity index 100%
rename from fence/agents/drac/drac5.py
rename to fence/agents/drac/fence_drac5.py
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
index c0a0290..3926e01 100644
--- a/fence/agents/ilo/Makefile
+++ b/fence/agents/ilo/Makefile
@@ -15,8 +15,4 @@ include ../../../make/defines.mk
 
 TARGET= fence_ilo
 
-ifdef enable_experimental_fence_agents
-TARGET += ilo
-endif
-
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/ilo/fence_ilo.pl b/fence/agents/ilo/fence_ilo.pl
deleted file mode 100755
index ba739e7..0000000
--- a/fence/agents/ilo/fence_ilo.pl
+++ /dev/null
@@ -1,655 +0,0 @@
-#!/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} || 
-eval { $ssl_mod="Net::SSLeay::Handle" if require Net::SSLeay::Handle } || 
-	die "Net::SSL.pm or Net::SSLeay::Handle.pm not found.\n".
-	    "Please install the perl-Crypt-SSLeay package from RHN (http://rhn.redhat.com)\n".
-	    "or Net::SSLeay from CPAN (http://www.cpan.org)\n";
-
-use IO::Socket;
-use Getopt::Std;
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-
-################################################################################
-sub usage 
-{
-	print "Usage:\n";
-	print "\n";
-	print "$pname [options]\n";
-	print "\n";
-	print "Options:\n";
-	print "  -a <ip>          IP address or hostname of iLO card\n";
-	print "  -h               usage\n";
-	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";
-	exit 0;
-}
-
-
-sub fail
-{
-	($msg)= _;
-	print $msg unless defined $quiet;
-	exit 1;
-}
-
-
-sub fail_usage
-{
-	($msg)= _;
-	print STDERR $msg if $msg;
-	print STDERR "Please use '-h' for usage.\n";
-	exit 1;
-}
-
-
-sub version
-{
-	print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-	print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-	exit 0;
-}
-
-
-sub sendsock
-{
-	my ($sock, $msg, $junk) = @_;
-
-	$sock->print($msg);
-	if ($verbose)
-	{
-		chomp $msg;
-		print "SEND: $msg\n" 
-	}
-}
-
-
-# This will slurp up all the data on the socket.  The SSL connection 
-# automatically times out after 10 seconds.  If $mode is defined, the 
-# function will return immediately following the initial packet 
-# terminator "<END_RIBCL/>" or "</RIBCL>" 
-#    RIBCL VERSION=1.2  -> <END_RIBCL/>
-#    RIBCL VERSION=2.0  -> </RIBCL>
-sub receive_response
-{
-	my ($sock,$mode) = @_;
-	$mode = 0 unless defined $mode;
-	my $count=0;
-
-	my $buf;
-	my $buffer = "";
-
-	### sock should automatically be closed by iLO after 10 seconds
-	### XXX read buf length of 256.  Is this enough?  Do I need to buffer?
-	while ($ssl_mod eq "Net::SSLeay::Handle" ? $buf=<$sock> : $sock->read($buf,256) )
-	{
-		$rd = length($buf);
-		last unless ($rd);
-
-		$buffer="$buffer$buf"; 
-		if ($verbose)
-		{
-			chomp $buf;
-			print "READ:($rd,$mode) $buf\n";
-		}
-
-		# RIBCL VERSION=1.2
-		last if ( $buffer =~ /<END_RIBCL\/>$/mi && $mode==1 );
-
-		# RIBCL VERSION=2.0
-		last if ( $buffer =~ /<\/RIBCL>$/mi && $mode==1 );
-	}
-
-	### Determine version of RIBCL if not already defined
-	if (!defined $ribcl_vers)
-	{
-		if ($buffer =~ /<RIBCL VERSION=\"([0-9.]+)\"/m)
-		{
-			$ribcl_vers=$1;
-			print "ribcl_vers=$ribcl_vers\n" if ($verbose);
-		}
-		else
-		{
-			fail "unable to detect RIBCL version\n";
-		}
-	}
-
-	return $buffer;
-}
-
-
-sub open_socket
-{
-	print "opening connection to $hostname:$port\n" if $verbose;
-
-	if ($ssl_mod eq "Net::SSLeay::Handle")
-	{
-		# neat little trick I found in the man page for Net::SSLeay::Handle
-		tie (*SSL,"Net::SSLeay::Handle",$hostname,$port)
-			or fail "unable to connect to $hostname:$port $ \n";
-		$ssl = \*SSL;
-	}
-	else
-	{
-		$ssl = Net::SSL->new( PeerAddr => $hostname,
-			              PeerPort => $port );
-		$ssl->configure();
-		$ssl->connect($port,inet_aton($hostname)) or 
-			fail "unable to connect to $hostname:$port $ \n";
-	}
-	return $ssl; 
-}
-
-
-sub close_socket
-{
-	my ($sock, $junk) = @_;
-	#shutdown ($sock,1);
-	close $sock;
-}
-
-
-# power_off() -- power off the node
-#   return 0 on success, non-zero on failure
-sub power_off
-{
-	my $response = set_power_state ("N");
-	my @response = split /\n/,$response;
-	my $no_err=0;
-	my $agent_status = -1;
-
-	foreach my $line (@response)
-	{
-		if ($line =~ /MESSAGE='(.*)'/)
-		{
-			my $msg = $1;
-			if ($msg eq "No error") 
-			{ 
-				$no_err++;
-				next; 
-			}
-			elsif ($msg eq "Host power is already OFF.")
-			{
-				$agent_status = 0;
-				print "warning: $msg\n" unless defined $quiet;
-			}
-			else
-			{
-				$agent_status = 1;
-				print STDERR "error: $msg\n";
-			}
-		}
-	}
-
-	# There should be about 6 or more response packets on a successful
-	# power off command.  
-	if ($agent_status<0)
-	{
-		$agent_status = ($no_err<5) ? 1 : 0;
-	} 
-
-	return $agent_status;
-}
-
-
-# power_on() -- power on the node
-#   return 0 on success, non-zero on failure
-sub power_on
-{
-	my $response = set_power_state ("Y");
-	my @response = split /\n/,$response;
-	my $no_err=0;
-	my $agent_status = -1;
-
-	foreach my $line (@response)
-	{
-		if ($line =~ /MESSAGE='(.*)'/)
-		{
-			my $msg = $1;
-			if ($msg eq "No error") 
-			{ 
-				$no_err++;
-				next; 
-			}
-			elsif ($msg eq "Host power is already ON.")
-			{
-				$agent_status = 0;
-				print "warning: $msg\n" unless defined $quiet;
-			}
-			else
-			{
-				$agent_status = 1;
-				print STDERR "error: $msg\n";
-			}
-		}
-	}
-
-	# There should be about 6 or more response packets on a successful
-	# power on command.  
-	if ($agent_status<0)
-	{
-		$agent_status = ($no_err<5) ? 1 : 0;
-	} 
-
-	return $agent_status;
-}
-
-# power_status() -- print the power status of the node
-#   return 0 on success, non-zero on failure 
-#   set $? to power status from ilo ("ON" or "OFF")
-sub power_status
-{
-	my $response = get_power_state ();
-	my @response = split /\n/,$response;
-	my $agent_status = -1;
-	my $power_status = "UNKNOWN";
-
-	foreach my $line (@response)
-	{
-		if ($line =~ /FIRMWARE_VERSION\s*=\s*\"(.*)\"/) {
-			$firmware_rev = $1;
-		}
-		if ($line =~ /MANAGEMENT_PROCESSOR\s*=\s*\"(.*)\"/) {
-			if ($1 eq "iLO2") {
-				$ilo_vers = 2;
-				print "power_status: reporting iLO2 $firmware_rev\n" if ($verbose);
-			}
-		}
-
-		if ($line =~ /MESSAGE='(.*)'/)
-		{
-			my $msg = $1;
-			if ($msg eq "No error") 
-			{ 
-				next; 
-			}
-			else
-			{
-				$agent_status = 1;
-				print STDERR "error: $msg\n";
-			}
-		}
-		# RIBCL VERSION=1.2   
-		elsif ($line =~ /HOST POWER=\"(.*)\"/)
-		{
-			$agent_status = 0;
-			$power_status = $1;
-		}
-
-		# RIBCL VERSION=2.0   
-		elsif ($line =~ /HOST_POWER=\"(.*)\"/)
-		{
-			$agent_status = 0;
-			$power_status = $1;
-		}
-
-	}
-	$_ = $power_status;
-	print "power_status: reporting power is $_\n" if ($verbose);
-	return $agent_status;
-}
-
-sub set_power_state
-{
-	my $state = shift;
-	my $response = "";
-
-	if (!defined $state || ( $state ne "Y" && $state ne "N") )
-	{
-		fail "illegal state\n";
-	}
-
-	$socket = open_socket;
-
-	sendsock $socket, "<?xml version=\"1.0\"?>\r\n";
-	$response = receive_response($socket,1);
-
-	print "Sending power-o".(($state eq "Y")?"n":"ff")."\n" if ($verbose);
-
-	if ($ribcl_vers < 2 )
-	{
-		sendsock $socket, "<RIBCL VERSION=\"1.2\">\n";
-	}
-	else
-	{
-		# It seems the firmware can't handle the <LOCFG> tag
-		# RIBCL VERSION=2.0
-		#> sendsock $socket, "<LOCFG VERSION=\"2.21\">\n";
-		sendsock $socket, "<RIBCL VERSION=\"2.0\">\n";
-	}
-	sendsock $socket, "<LOGIN USER_LOGIN = \"$username\" PASSWORD = \"$passwd\">\n";
-	sendsock $socket, "<SERVER_INFO MODE = \"write\">\n";
-
-	if ($ilo_vers == 2) {
-		# iLO2 with RIBCL v2.22 behaves differently from
-		# iLO with RIBCL v2.22. For the former, HOLD_PWR_BTN is
-		# used to both power the machine on and off; when the power
-		# is off, PRESS_PWR_BUTTON has no effect. For the latter,
-		# HOLD_PWR_BUTTON is used to power the machine off, and
-		# PRESS_PWR_BUTTON is used to power the machine on;
-		# when the power is off, HOLD_PWR_BUTTON has no effect.
-		if ($firmware_rev > 1.29) {
-			sendsock $socket, "<HOLD_PWR_BTN TOGGLE=\"Yes\" />\n";
-		} else {
-			sendsock $socket, "<HOLD_PWR_BTN/>\n";
-		}
-	}
-	# As of firmware version 1.71 (RIBCL 2.21) The SET_HOST_POWER command
-	# is no longer available.  HOLD_PWR_BTN and PRESS_PWR_BTN are used 
-	# instead now :(
-	elsif ($ribcl_vers < 2.21)
-	{
-		sendsock $socket, "<SET_HOST_POWER HOST_POWER = \"$state\"/>\n";
-	}
-	else
-	{
-		if ($state eq "Y" )
-		{ 
-			sendsock $socket, "<PRESS_PWR_BTN/>\n";
-		} 
-		else 
-		{
-			sendsock $socket, "<HOLD_PWR_BTN/>\n";
-		}
-	}
-
-	sendsock $socket, "</SERVER_INFO>\n";
-	sendsock $socket, "</LOGIN>\n";
-	sendsock $socket, "</RIBCL>\n";
-
-	# It seems the firmware can't handle the <LOCFG> tag
-	# RIBCL VERSION=2.0
-	#> sendsock $socket, "</LOCFG>\n" if ($ribcl_vers >= 2) ;
-
-	$response = receive_response($socket);
-
-	print "Closing connection\n" if ($verbose);
-	close_socket($socket);
-
-	return $response;
-}
-
-sub get_power_state
-{
-	my $response = "";
-
-	$socket = open_socket;
-
-	sendsock $socket, "<?xml version=\"1.0\"?>\r\n";
-	$response = receive_response($socket,1);
-
-	print "Sending get-status\n" if ($verbose);
-
-	if ($ribcl_vers < 2 )
-	{
-		sendsock $socket, "<RIBCL VERSION=\"1.2\">\n";
-	}
-	else
-	{
-		# It seems the firmware can't handle the <LOCFG> tag
-		# RIBCL VERSION=2.0
-		#> sendsock $socket, "<LOCFG VERSION=\"2.21\">\n";
-		sendsock $socket, "<RIBCL VERSION=\"2.0\">\n";
-	}
-	sendsock $socket, "<LOGIN USER_LOGIN = \"$username\" PASSWORD = \"$passwd\">\n";
-	if ($ribcl_vers >= 2) {
-	    sendsock $socket, "<RIB_INFO MODE=\"read\"><GET_FW_VERSION/></RIB_INFO>\n";
-	}
-	sendsock $socket, "<SERVER_INFO MODE = \"read\">\n";
-	sendsock $socket, "<GET_HOST_POWER_STATUS/>\n";
-	sendsock $socket, "</SERVER_INFO>\n";
-	sendsock $socket, "</LOGIN>\n";
-	sendsock $socket, "</RIBCL>\n";
-
-	# It seems the firmware can't handle the <LOCFG> tag
-	# RIBCL VERSION=2.0
-	#> sendsock $socket, "</LOCFG>\r\n" if ($ribcl_vers >= 2) ;
-
-	$response = receive_response($socket);
-
-	print "Closing connection\n" if ($verbose);
-	close_socket($socket);
-    
-	return $response;
-}
-
-
-sub get_options_stdin
-{
-	my $opt;
-	my $line = 0;
-	while( defined($in = <>) )
-	{
-		$_ = $in;
-
-		chomp;
-
-		# strip leading and trailing whitespace
-		s/^\s*//;
-		s/\s*$//;
-
-		# skip comments
-		next if /^#/;
-
-		$line+=1;
-		$opt=$_;
-		next unless $opt;
-
-		($name,$val)=split /\s*=\s*/, $opt;
-
-		if ( $name eq "" )
-		{
-			print STDERR "parse error: illegal name in option $line\n";
-			exit 2;
-		}
-
-		elsif ($name eq "action" || $name eq "option")
-		{
-				$action = $val;
-		}
-
-		# DO NOTHING -- this field is used by fenced or stomithd
-		elsif ($name eq "agent" ) { }
-
-		elsif ($name eq "hostname" )
-		{
-			$hostname = $val;
-		}
-		elsif ($name eq "login" )
-		{
-			$username = $val;
-		}
-		elsif ($name eq "passwd" )
-		{
-			$passwd = $val;
-		}
-		elsif ($name eq "passwd_script" )
-		{
-			$passwd_script = $val;
-		}
-		elsif ($name eq "ribcl" )
-		{
-			$ribcl_vers = $val;
-		}
-		elsif ($name eq "verbose" )
-		{
-			$verbose = $val;
-		}
-
-	}
-}
-
-################################################################################
-# MAIN
-
-$action = "reboot";
-$ribcl_vers = undef; # undef = autodetect
-$ilo_vers = 1;
-$firmware_rev = 0;
-
-if (@ARGV > 0) {
-	getopts("a:hl:n:o:p:S:r:qvV") || 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;
-	$hostname = $opt_a;
-
-	fail_usage "No '-l' flag specified." unless defined $opt_l;
-	$username = $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_usage "No '-p' or '-S' flag specified." unless defined $opt_p;
-	$passwd   = $opt_p;
-
-	$action = $opt_o if defined $opt_o;
-	fail_usage "Unrecognised action '$action' for '-o' flag"
-		unless $action=~ /^(off|on|reboot|status)$/;
-
-	$localport = $opt_n if defined $opt_n;
-
-	$quiet = 1 if defined $opt_q;
-
-	$verbose = 1 if defined $opt_v;
-
-	$ribcl_vers = $opt_r if defined $opt_r;
-
-} else {
-	get_options_stdin();
-
-	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"
-		unless $action=~ /^(off|on|reboot|status)$/;
-}
-
-# Parse user specified port from apaddr parameter
-($hostname_tmp,$port,$junk) = split(/:/,$hostname); 
-fail "bad hostname/ipaddr format: $hostname\n" if defined $junk;
-$hostname = $hostname_tmp;
-$port = 443 unless defined $port;
-
-print "ssl module: $ssl_mod\n" if $verbose;
-
-
-$_=$action;
-if (/on/)
-{
-	fail "power_status: unexpected error\n" if power_status;
-
-	if (! /^on$/i)
-	{
-		fail "power_on: unexpected error\n" if power_on;
-		fail "power_status: unexpected error\n" if power_status;
-		fail "failed to turn on\n" unless (/^on$/i); 
-	}
-	else
-	{
-		print "power is already on\n" unless defined $quiet;
-	}
-}
-elsif (/off/)
-{
-	fail "power_status: unexpected error\n" if power_status;
-
-	if (! /^off$/i)
-	{
-		fail "power_off: unexpected error\n" if power_off;
-		fail "power_status: unexpected error\n" if power_status;
-		fail "failed to turn off\n" unless (/^off$/i); 
-	}
-	else
-	{
-		print "power is already off\n" unless defined $quiet;
-	}
-}
-elsif (/reboot/)
-{
-	fail "power_status: unexpected error\n" if power_status;
-
-	if (! /^off$/i)
-	{
-		fail "power_off: unexpected error\n" if power_off;
-		fail "power_status: unexpected error\n" if power_status;
-		fail "failed to turn off\n" unless (/^off$/i); 
-	}
-
-	if (/^off$/i)
-	{
-		fail "power_on: unexpected error\n" if power_on;
-		fail "power_status: unexpected error\n" if power_status;
-		fail "failed to turn on\n" unless (/^on$/i); 
-	}
-	else
-	{
-		fail "unexpected power state: '$_'\n";
-	}
-}
-elsif (/status/)
-{
-	fail "power_status: unexpected error\n" if power_status;
-	print "power is $_\n";
-}
-else
-{
-	fail "illegal action: '$_'\n";
-}
-
-print "success\n" unless defined $quiet;
-exit 0
-
-################################################################################
diff --git a/fence/agents/ilo/ilo.py b/fence/agents/ilo/fence_ilo.py
similarity index 100%
rename from fence/agents/ilo/ilo.py
rename to fence/agents/ilo/fence_ilo.py
diff --git a/fence/agents/lib/Makefile b/fence/agents/lib/Makefile
index 76d96dc..4ea39e2 100644
--- a/fence/agents/lib/Makefile
+++ b/fence/agents/lib/Makefile
@@ -14,12 +14,8 @@
 
 include ../../../make/defines.mk
 
-ifdef enable_experimental_fence_agents
-
 TARGET= fencing.py
 
 FENCEAGENTSLIB= $(TARGET)
 
-endif
-
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
index 3a59521..414ad09 100644
--- a/fence/agents/wti/Makefile
+++ b/fence/agents/wti/Makefile
@@ -15,8 +15,4 @@ include ../../../make/defines.mk
 
 TARGET= fence_wti
 
-ifdef enable_experimental_fence_agents
-TARGET += wti
-endif
-
 include $(OBJDIR)/make/fencebuild.mk
diff --git a/fence/agents/wti/fence_wti.pl b/fence/agents/wti/fence_wti.pl
deleted file mode 100755
index 6c1dc97..0000000
--- a/fence/agents/wti/fence_wti.pl
+++ /dev/null
@@ -1,384 +0,0 @@
-#!/usr/bin/perl
-
-###############################################################################
-###############################################################################
-##
-##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004 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.
-##
-###############################################################################
-###############################################################################
-
-use Getopt::Std;
-use Net::Telnet ();
-
-# Get the program name from $0 and strip directory names
-$_=$0;
-s/.*\///;
-my $pname = $_;
-
-
-# WARNING!! Do not add code bewteen "#BEGIN_VERSION_GENERATION" and 
-# "#END_VERSION_GENERATION"  It is generated by the Makefile
-
-#BEGIN_VERSION_GENERATION
-$RELEASE_VERSION="";
-$REDHAT_COPYRIGHT="";
-$BUILD_DATE="";
-#END_VERSION_GENERATION
-
-
-sub usage
-{
-    print "Usage:\n";  
-    print "\n";
-    print "$pname [options]\n";
-    print "\n";
-    print "Options:\n";
-    print "  -a <ip>          IP address or hostname of NPS\n";
-    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";
-    print "  -V               Version\n";
-
-    exit 0;
-}
-
-sub fail
-{
-  ($msg)= _;
-  print $msg."\n" unless defined $opt_q;
-  $t->close if defined $t;
-  exit 1;
-}
-
-sub fail_usage
-{
-  ($msg)= _;
-  print STDERR $msg."\n" if $msg;
-  print STDERR "Please use '-h' for usage.\n";
-  exit 1;
-}
-
-sub version
-{
-  print "$pname $RELEASE_VERSION $BUILD_DATE\n";
-  print "$REDHAT_COPYRIGHT\n" if ( $REDHAT_COPYRIGHT );
-
-  exit 0;
-}
-
-$opt_o = "reboot";
-if (@ARGV > 0) {
-   getopts("a:hn:p:S:qTVo:") || 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 '-n' flag specified." 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_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;
-}
-
-$t = new Net::Telnet;
-
-$t->open($opt_a);
-
-$expr = '/:|\n/';
-
-while (1)
-{
-  ($line, $match) = $t->waitfor($expr);
-
-  if ($line =~ /assword/)
-  {
-    fail "failed: no password" unless defined $opt_p;
-    $t->print($opt_p);
-    $expr = '/\n/';
-  }
-
-  elsif ($line =~ /v\d.\d+/)
-  {
-    $line =~ /\D*(\d)\.(\d+).*/;
-    $ver1 = $1;
-    $ver2 = $2;
-
-    $t->waitfor('/(TPS|IPS|RPC|NPS|NBB)\>/'); 
-    last;
-  }
-}
-
-
-if (defined $opt_T)
-{
-  &test($t);
-  exit 0;
-}
-
-
-# to be most certain of success, turn off, check for OFF status, turn ON, check
-# for ON status
-if (($opt_o eq "off") || ($opt_o eq "reboot")) {
-  $t->print("/off $opt_n");
-  ($line, $match) = $t->waitfor('/\(Y\/N\)|(TPS|IPS|RPC|NPS|NBB)\>/');
-
-  if ($match =~ /Y\/N/)
-  {
-    $t->print("y");
-    $t->waitfor('/(TPS|IPS|RPC|NPS|NBB)\>/');
-  }
-
-  $t->print("/s");
-
-  while (1)
-  {
-    ($line, $match) = $t->waitfor('/\n|(TPS|IPS|RPC|NPS|NBB)\>/');
-
-    if ($match =~ /(TPS|IPS|RPC|NPS|NBB)\>/)
-    {
-      print "failed: plug number \"$opt_n\" not found\n"
-         unless defined $opt_q;
-      exit 1;
-    }
-    
-    $line =~ /^\s+(\d+).*/;
-
-    if ($1 == $opt_n)
-    {
-      # For (TPS|IPS|RPC|NPS)
-      if($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      # For NBB
-      } elsif($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      }
-
-      if ($state =~ /OFF/)
-      {
-        $t->waitfor('/(TPS|IPS|RPC|NPS|NBB)\>/');
-        last;
-      }
-
-      print "failed: plug not off ($state)\n"
-         unless defined $opt_q;
-      exit 1;
-    }
-  }
-}
-
-
-# at this point, failing to turn the machine back on shouldn't be a failure
-
-if (($opt_o eq "on") || ($opt_o eq "reboot")) {
-  sleep 5;
-  $t->print("/on $opt_n");
-  ($line, $match) = $t->waitfor('/\(Y\/N\)|(TPS|IPS|RPC|NPS|NBB)\>/');
-
-  if ($match =~ /Y\/N/)
-  {
-    $t->print("y");
-    $t->waitfor('/(TPS|IPS|RPC|NPS|NBB)\>/');
-  }
-
-  $t->print("/s");
-  
-  while (1)
-  {
-    ($line, $match) = $t->waitfor('/\n|(TPS|IPS|RPC|NPS|NBB)\>/');
-
-    if ($match =~ /(TPS|IPS|RPC|NPS|NBB)\>/)
-    {
-      print "success: plug-on warning\n"
-         unless defined $opt_q;
-      exit 0;
-    }
-
-    $line =~ /^\s+(\d+).*/;
-
-    if ($1 == $opt_n)
-    {
-      # For (TPS|IPS|RPC|NPS)
-      if($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      # For NBB
-      } elsif($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      }
-
-      if ($state =~ /ON/)
-      {
-        $t->waitfor('/(TPS|IPS|RPC|NPS|NBB)\>/');
-        last;
-      }
-
-      print "success: plug state warning ($state)\n"  
-        unless defined $opt_q;
-
-      exit 0;
-    }
-  }
-}
-
-print "success: $opt_o operation on plug $opt_n\n" unless defined $opt_q;
-
-exit 0;
-
-
-
-sub test
-{
-  local($t) = @_;
-
-  $t->print("/s");
-
-  while (1)
-  {
-    ($line, $match) = $t->waitfor('/\n|(TPS|IPS|RPC|NPS|NBB)\>/');
-
-    if ($match =~ /(TPS|IPS|RPC|NPS|NBB)\>/)
-    {
-      print "failed: plug number \"$opt_n\" not found\n"
-          unless defined $opt_q;
-      exit 1;
-    }
-
-    $line =~ /^\s+(\d+).*/;
-
-    if ($1 == $opt_n)
-    {
-      # For (TPS|IPS|RPC|NPS)
-      if($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      # For NBB
-      } elsif($line =~ /^\s+(\d+)\s+\|\s+\S+\s+\|\s+\S+\s+\|\s+(\w+).*/){
-        $state = $2;
-      }
-
-      if ($state =~ /ON|OFF/)
-      {
-        print "success: current plug state \"$state\"\n" 
-          unless defined $opt_q;
-      }
-
-      else
-      {
-        print "failed: unknown plug state \"$state\"\n"
-          unless defined $opt_q;
-      }
-    
-      last;
-    }
-  }
-}
-
-sub get_options_stdin
-{
-    my $opt;
-    my $line = 0;
-    while( defined($in = <>) )
-    {
-        $_ = $in;
-
-        chomp;
-
-        # strip leading and trailing whitespace
-        s/^\s*//;
-        s/\s*$//;
-
-        # skip comments
-        next if /^#/;
-
-        $line+=1;
-        $opt=$_;
-        next unless $opt;
-
-        ($name,$val)=split /\s*=\s*/, $opt;
-
-        if ( $name eq "" )
-        {
-           print STDERR "parse error: illegal name in option $line\n";
-           exit 2;
-        }
-
-        # DO NOTHING -- this field is used by fenced
-        elsif ($name eq "agent" ) { }
-
-        # FIXME -- deprecated.  use "port" instead.
-        elsif ($name eq "fm" )
-        {
-            (my $dummy,$opt_n) = split /\s+/,$val;
-            print STDERR "Deprecated \"fm\" entry detected.  refer to man page.\n";
-        }
-
-        elsif ($name eq "ipaddr" )
-        {
-            $opt_a = $val;
-        }
-
-	# FIXME -- depreicated residue of old fencing system
-        elsif ($name eq "name" ) { }
-
-        elsif ($name eq "passwd" )
-        {
-            $opt_p = $val;
-        }
-		elsif ($name eq "passwd_script" )
-		{
-			$opt_S = $val;
-		}
-        elsif ($name eq "port" )
-        {
-            $opt_n = $val;
-        }
-        elsif ($name eq "option" )
-        {
-            $opt_o = $val;
-        }
-        # elsif ($name eq "test" ) 
-        # {
-        #    $opt_T = $val;
-        # } 
-
-        # FIXME should we do more error checking?  
-        # Excess name/vals will be eaten for now
-        else
-        {
-           fail "parse error: unknown option \"$opt\"\n";
-        }
-    }
-}
diff --git a/fence/agents/wti/wti.py b/fence/agents/wti/fence_wti.py
similarity index 100%
rename from fence/agents/wti/wti.py
rename to fence/agents/wti/fence_wti.py
diff --git a/make/defines.mk.input b/make/defines.mk.input
index bdf0db3..7c5ac6a 100644
--- a/make/defines.mk.input
+++ b/make/defines.mk.input
@@ -73,7 +73,6 @@ virtincdir ?= @VIRTINCDIR@
 virtlibdir ?= @VIRTLIBDIR@
 fence_agents ?= @FENCE_AGENTS@
 fenceagentslibdir ?= @FENCEAGENTSLIBDIR@
-enable_experimental_fence_agents ?= @ENABLE_EXPERIMENTAL_FENCE_AGENTS@
 experimental_build ?= @ENABLE_CRACK_OF_THE_DAY@
 enable_xen ?= @ENABLE_XEN@
 without_gnbd-kernel/src ?= @DISABLE_GNBD@


hooks/post-receive
--
Cluster Project


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