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

[Cluster-devel] Cluster Project branch, RHEL4, updated. gfs-kernel_2_6_9_76-48-g8320af0



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=8320af0abf410ba4df358974376fc71571e03cd6

The branch, RHEL4 has been updated
       via  8320af0abf410ba4df358974376fc71571e03cd6 (commit)
      from  bcfdaa69b501fef4d01abcf1104d87d00484da66 (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 8320af0abf410ba4df358974376fc71571e03cd6
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Fri Apr 25 15:28:18 2008 +0200

    [FENCE] Enable new fence agents by default
    
    agents/Makefile:
     - enable lib target.
    
    agents/apc/fence_apc.py, bladecenter/fence_bladecenter.py,
    agents/drac/fence_drac5.py, agents/ilo/fence_ilo.py,
    agents/lib/fencing.py.py, agents/wti/fence_wti.py:
     - add version, build and copyright information.
     - fix path to fence agents lib.
    
    agents/bladecenter/Makefile, fence/agents/drac/Makefile, agents/ilo/Makefile,
    agents/wti/Makefile:
     - enable new agents.
    
    bin/Makefile:
     - install fence_drac5
     - install/uninstall fence library
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

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

Summary of changes:
 fence/agents/Makefile                              |    3 +
 fence/agents/apc/apc.py                            |   94 --
 fence/agents/apc/fence_apc.py                      |  902 ++------------------
 fence/agents/bladecenter/Makefile                  |    6 +-
 .../{bladecenter.py => fence_bladecenter.py}       |    8 +-
 fence/agents/drac/Makefile                         |   39 +-
 fence/agents/drac/{drac5.py => fence_drac5.py}     |    8 +-
 fence/agents/ilo/Makefile                          |    4 +-
 fence/agents/ilo/{ilo.py => fence_ilo.py}          |    8 +-
 fence/agents/{apc => lib}/Makefile                 |    6 +-
 fence/agents/lib/{fencing.py => fencing.py.py}     |   10 +-
 fence/agents/wti/Makefile                          |    4 +-
 fence/agents/wti/{wti.py => fence_wti.py}          |    8 +-
 fence/bin/Makefile                                 |   11 +-
 14 files changed, 171 insertions(+), 940 deletions(-)
 delete mode 100755 fence/agents/apc/apc.py
 mode change 100644 => 100755 fence/agents/apc/fence_apc.py
 rename fence/agents/bladecenter/{bladecenter.py => fence_bladecenter.py} (93%)
 rename fence/agents/drac/{drac5.py => fence_drac5.py} (92%)
 rename fence/agents/ilo/{ilo.py => fence_ilo.py} (91%)
 copy fence/agents/{apc => lib}/Makefile (95%)
 rename fence/agents/lib/{fencing.py => fencing.py.py} (97%)
 rename fence/agents/wti/{wti.py => fence_wti.py} (94%)

diff --git a/fence/agents/Makefile b/fence/agents/Makefile
index 8418016..080863c 100644
--- a/fence/agents/Makefile
+++ b/fence/agents/Makefile
@@ -13,6 +13,7 @@
 
 
 all:
+	cd lib && ${MAKE} all
 	cd apc && ${MAKE} all
 	cd apc_snmp && ${MAKE} all
 	cd rsa && ${MAKE} all
@@ -40,6 +41,7 @@ all:
 	# cd zvm && ${MAKE} all
 
 copytobin:
+	cd lib && ${MAKE} copytobin
 	cd apc && ${MAKE} copytobin
 	cd apc_snmp && ${MAKE} copytobin
 	cd rsa && ${MAKE} copytobin
@@ -67,6 +69,7 @@ copytobin:
 	# cd zvm && ${MAKE} copytobin
 
 clean:
+	cd lib && ${MAKE} clean
 	cd apc && ${MAKE} clean
 	cd apc_snmp && ${MAKE} clean
 	cd rsa && ${MAKE} clean
diff --git a/fence/agents/apc/apc.py b/fence/agents/apc/apc.py
deleted file mode 100755
index bcea997..0000000
--- a/fence/agents/apc/apc.py
+++ /dev/null
@@ -1,94 +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("../lib/")
-from fencing import *
-
-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 e28d6e2..a588236
--- a/fence/agents/apc/fence_apc.py
+++ b/fence/agents/apc/fence_apc.py
@@ -1,832 +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("/usr/lib/fence")
+from fencing import *
 
 #BEGIN_VERSION_GENERATION
-FENCE_RELEASE_NAME="New APC Agent - test release"
+FENCE_RELEASE_NAME=""
 REDHAT_COPYRIGHT=""
-BUILD_DATE="September 21, 2006"
+BUILD_DATE=""
 #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" % (FENCE_RELEASE_NAME, 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:
-          #Changed for bz299191
-          #res = "2\r1\r"
-          res = "2\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):
-      #Changed for bz299191
-      #return (NOT_COMPLETE, "\r")
-      return (NOT_COMPLETE, "1\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 6bd15a8..d6a30c9 100644
--- a/fence/agents/bladecenter/Makefile
+++ b/fence/agents/bladecenter/Makefile
@@ -11,7 +11,7 @@
 ###############################################################################
 ###############################################################################
 
-SOURCE= fence_bladecenter.pl
+SOURCE= fence_bladecenter.py
 TARGET= fence_bladecenter
 
 top_srcdir=../..
@@ -19,11 +19,11 @@ include ${top_srcdir}/make/defines.mk
 
 all: $(TARGET)
 
-fence_bladecenter: fence_bladecenter.pl
+fence_bladecenter: fence_bladecenter.py
 	: > $(TARGET)
 	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
 	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
-	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
+	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET)
 	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
 	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET)
 	chmod +x $(TARGET)
diff --git a/fence/agents/bladecenter/bladecenter.py b/fence/agents/bladecenter/fence_bladecenter.py
similarity index 93%
rename from fence/agents/bladecenter/bladecenter.py
rename to fence/agents/bladecenter/fence_bladecenter.py
index cbc7daa..a3ff651 100755
--- a/fence/agents/bladecenter/bladecenter.py
+++ b/fence/agents/bladecenter/fence_bladecenter.py
@@ -14,9 +14,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("/usr/lib/fence")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		node_cmd = "system:blade\[" + options["-n"] + "\]>"
diff --git a/fence/agents/drac/Makefile b/fence/agents/drac/Makefile
index 258f5ff..294c86d 100644
--- a/fence/agents/drac/Makefile
+++ b/fence/agents/drac/Makefile
@@ -11,25 +11,38 @@
 ###############################################################################
 ###############################################################################
 
-SOURCE= fence_drac.pl
-TARGET= fence_drac
+SOURCE1= fence_drac.pl
+TARGET1= fence_drac
+
+SOURCE2= fence_drac5.py
+TARGET2= fence_drac5
 
 top_srcdir=../..
 include ${top_srcdir}/make/defines.mk
 
-all: $(TARGET)
+all: $(TARGET1) $(TARGET2)
 
 fence_drac: fence_drac.pl
-	: > $(TARGET)
-	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
-	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
-	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
-	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
-	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET)
-	chmod +x $(TARGET)
+	: > $(TARGET1)
+	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE1) >> $(TARGET1)
+	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET1)
+	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET1)
+	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET1)
+	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE1) >> $(TARGET1)
+	chmod +x $(TARGET1)
+
+fence_drac5: fence_drac5.py
+	: > $(TARGET2)
+	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE2) >> $(TARGET2)
+	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET2)
+	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET2)
+	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET2)
+	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE2) >> $(TARGET2)
+	chmod +x $(TARGET2)
 
-copytobin: ${TARGET}
-	cp ${TARGET} ${top_srcdir}/bin/${TARGET}
+copytobin: ${TARGET1} ${TARGET2}
+	cp ${TARGET1} ${top_srcdir}/bin/${TARGET1}
+	cp ${TARGET2} ${top_srcdir}/bin/${TARGET2}
 
 clean:
-	rm -f $(TARGET)
+	rm -f $(TARGET1) $(TARGET2)
diff --git a/fence/agents/drac/drac5.py b/fence/agents/drac/fence_drac5.py
similarity index 92%
rename from fence/agents/drac/drac5.py
rename to fence/agents/drac/fence_drac5.py
index 63012fc..d73b8f0 100755
--- a/fence/agents/drac/drac5.py
+++ b/fence/agents/drac/fence_drac5.py
@@ -14,9 +14,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("/usr/lib/fence")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.sendline("racadm serveraction powerstatus")
diff --git a/fence/agents/ilo/Makefile b/fence/agents/ilo/Makefile
index 4ea4299..42f17c8 100644
--- a/fence/agents/ilo/Makefile
+++ b/fence/agents/ilo/Makefile
@@ -11,7 +11,7 @@
 ###############################################################################
 ###############################################################################
 
-SOURCE= fence_ilo.pl
+SOURCE= fence_ilo.py
 TARGET= fence_ilo
 
 top_srcdir=../..
@@ -23,7 +23,7 @@ fence_ilo: $(SOURCE)
 	: > $(TARGET)
 	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
 	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
-	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
+	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET)
 	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
 	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET)
 	chmod +x $(TARGET)
diff --git a/fence/agents/ilo/ilo.py b/fence/agents/ilo/fence_ilo.py
similarity index 91%
rename from fence/agents/ilo/ilo.py
rename to fence/agents/ilo/fence_ilo.py
index 1f3e330..9a0dfbb 100755
--- a/fence/agents/ilo/ilo.py
+++ b/fence/agents/ilo/fence_ilo.py
@@ -13,9 +13,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("/usr/lib/fence")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.send("POWER\r\n")
diff --git a/fence/agents/apc/Makefile b/fence/agents/lib/Makefile
similarity index 95%
copy from fence/agents/apc/Makefile
copy to fence/agents/lib/Makefile
index a80f12b..d27454d 100644
--- a/fence/agents/apc/Makefile
+++ b/fence/agents/lib/Makefile
@@ -11,15 +11,15 @@
 ###############################################################################
 ###############################################################################
 
-SOURCE= fence_apc.py
-TARGET= fence_apc
+SOURCE= fencing.py.py
+TARGET= fencing.py
 
 top_srcdir=../..
 include ${top_srcdir}/make/defines.mk
 
 all: $(TARGET)
 
-fence_apc: fence_apc.py
+$(TARGET): $(SOURCE)
 	: > $(TARGET)
 	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
 	echo "FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
diff --git a/fence/agents/lib/fencing.py b/fence/agents/lib/fencing.py.py
similarity index 97%
rename from fence/agents/lib/fencing.py
rename to fence/agents/lib/fencing.py.py
index 39d1285..a9a5952 100644
--- a/fence/agents/lib/fencing.py
+++ b/fence/agents/lib/fencing.py.py
@@ -8,6 +8,13 @@ import sys, getopt, time, os
 import pexpect, re
 import telnetlib
 
+## do not add code here.
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
 POWER_TIMEOUT = 20
 SHELL_TIMEOUT = 3
 LOGIN_TIMEOUT = 5
@@ -226,7 +233,8 @@ def check_input(device_opt, opt):
 		sys.exit(0)
 
 	if options.has_key("-V"):
-		print "Version: 0.3 - 2008/03/19"
+		print FENCE_RELEASE_NAME, BUILD_DATE
+		print REDHAT_COPYRIGHT
 		sys.exit(0)
 
 	if options.has_key("-v"):
diff --git a/fence/agents/wti/Makefile b/fence/agents/wti/Makefile
index 2a47d4b..53b833a 100644
--- a/fence/agents/wti/Makefile
+++ b/fence/agents/wti/Makefile
@@ -11,7 +11,7 @@
 ###############################################################################
 ###############################################################################
 
-SOURCE= fence_wti.pl
+SOURCE= fence_wti.py
 TARGET= fence_wti
 
 top_srcdir=../..
@@ -23,7 +23,7 @@ $(TARGET): $(SOURCE)
 	: > $(TARGET)
 	awk "{print}(\$$1 ~ /#BEGIN_VERSION_GENERATION/){exit 0}" $(SOURCE) >> $(TARGET)
 	echo "\$$FENCE_RELEASE_NAME=\"${RELEASE}\";" >> $(TARGET)
-	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf perl REDHAT_COPYRIGHT >> $(TARGET)
+	${top_srcdir}/scripts/define2var ${top_srcdir}/config/copyright.cf sh REDHAT_COPYRIGHT >> $(TARGET)
 	echo "\$$BUILD_DATE=\"(built `date`)\";" >> $(TARGET)
 	awk -v p=0 "(\$$1 ~ /#END_VERSION_GENERATION/){p = 1} {if(p==1)print}" $(SOURCE) >> $(TARGET)
 	chmod +x $(TARGET)
diff --git a/fence/agents/wti/wti.py b/fence/agents/wti/fence_wti.py
similarity index 94%
rename from fence/agents/wti/wti.py
rename to fence/agents/wti/fence_wti.py
index 926d347..4bef408 100755
--- a/fence/agents/wti/wti.py
+++ b/fence/agents/wti/fence_wti.py
@@ -13,9 +13,15 @@
 #####
 
 import sys, re, pexpect
-sys.path.append("../lib/")
+sys.path.append("/usr/lib/fence")
 from fencing import *
 
+#BEGIN_VERSION_GENERATION
+FENCE_RELEASE_NAME=""
+REDHAT_COPYRIGHT=""
+BUILD_DATE=""
+#END_VERSION_GENERATION
+
 def get_power_status(conn, options):
 	try:
 		conn.send("/S"+"\r\n")
diff --git a/fence/bin/Makefile b/fence/bin/Makefile
index 68bf9a7..e1958a7 100644
--- a/fence/bin/Makefile
+++ b/fence/bin/Makefile
@@ -25,6 +25,7 @@ SBINPROGS= \
 	fence_baytech \
 	fence_brocade \
 	fence_drac \
+	fence_drac5 \
 	fence_egenera \
 	fence_ilo \
 	fence_manual \
@@ -46,6 +47,8 @@ SHAREPROGS = \
 	     powernet369.mib \
 	     README_SNMP
 
+FENCEPYLIB = \
+	     fencing.py
 
 include ${top_srcdir}/make/defines.mk
 
@@ -70,7 +73,13 @@ install: all
 	for v in ${SHAREPROGS}; do \
 		install -m644 $${v} ${sharedir}; \
 	done
+	if [ ! -d ${DESTDIR}/usr/lib/fence ]; then \
+		install -d ${DESTDIR}/usr/lib/fence; \
+	fi
+	for v in ${FENCEPYLIB}; do \
+		install -m644 $${v} ${DESTDIR}/usr/lib/fence; \
+	fi
 
 uninstall:
 	${UNINSTALL} ${SBINPROGS} ${sbindir}
-
+	${UNINSTALL} ${FENCEPYLIB} ${DESTDIR}/usr/lib/fence


hooks/post-receive
--
Cluster Project


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