Cluster Project branch, master, updated. gfs-kernel_0_1_22-103-g2c60edd
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".
The branch, master has been updated
via 2c60eddf3d7bedfd452c9583a7e957103e1eaa16 (commit)
from 4a5cd1e6a072618e0700bb0aabc73813fd49bbae (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 2c60eddf3d7bedfd452c9583a7e957103e1eaa16
Author: Marek 'marx' Grac <[email protected]> Date: Fri Mar 28 16:11:31 2008 +0100
fence/agents: New fencings agents
There are new fencing agents based on a new library. They need a 'pexpect' package. If it is possible there is support for both telnet and ssh. In this patch there are agents for: APC, BladeCenter, Drac 5, ILo and WTI. It is possible that backward compatibility is broken (to be fixed).
-----------------------------------------------------------------------
Summary of changes:
fence/agents/apc/apc.py | 94 ++++++++++ fence/agents/bladecenter/bladecenter.py | 84 +++++++++ fence/agents/drac/drac5.py | 72 ++++++++ fence/agents/ilo/ilo.py | 71 +++++++ fence/agents/lib/fencing.py | 303 +++++++++++++++++++++++++++++++ fence/agents/wti/wti-ips.py | 100 ++++++++++ fence/agents/wti/wti-rsm.py | 87 +++++++++ 7 files changed, 811 insertions(+), 0 deletions(-) create mode 100755 fence/agents/apc/apc.py create mode 100755 fence/agents/bladecenter/bladecenter.py create mode 100755 fence/agents/drac/drac5.py create mode 100755 fence/agents/ilo/ilo.py create mode 100644 fence/agents/lib/fencing.py create mode 100755 fence/agents/wti/wti-ips.py create mode 100755 fence/agents/wti/wti-rsm.py
fence/agents/apc/apc.py new file +94 -0
@@ -0,0 +1,94 @@ +#!/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" ] + + 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()
fence/agents/bladecenter/bladecenter.py new file +84 -0
84 lines not on this page · raw message
fence/agents/drac/drac5.py new file +72 -0
72 lines not on this page · raw message
fence/agents/ilo/ilo.py new file +71 -0
71 lines not on this page · raw message
fence/agents/lib/fencing.py new file +303 -0
303 lines not on this page · raw message
fence/agents/wti/wti-ips.py new file +100 -0
100 lines not on this page · raw message
fence/agents/wti/wti-rsm.py new file +87 -0
87 lines not on this page · raw message
hooks/post-receive
--
Cluster Project