public inbox for cluster-cvs@sourceware.org help / color / mirror / Atom feed
From: "Marek Grác" <marx@fedoraproject.org> To: cluster-cvs-relay@redhat.com Subject: cluster: RHEL5 - [FENCE] #462390 - Support for iDRAC on Dell M600 Blade Chassis Date: Fri, 24 Apr 2009 12:51:00 -0000 [thread overview] Message-ID: <20090424125114.ADDC2120246@lists.fedorahosted.org> (raw) Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8ae3300d9073abdad6f2b85629e8e01a67bd0680 Commit: 8ae3300d9073abdad6f2b85629e8e01a67bd0680 Parent: 0f14eedae257f538a1286b1543e10da24b23e214 Author: Marek 'marx' Grac <mgrac@redhat.com> AuthorDate: Fri Apr 24 14:47:44 2009 +0200 Committer: Marek 'marx' Grac <mgrac@redhat.com> CommitterDate: Fri Apr 24 14:47:44 2009 +0200 [FENCE] #462390 - Support for iDRAC on Dell M600 Blade Chassis Add support for M600 to existing agent used for drac5. --- fence/agents/drac/fence_drac5.py | 38 +++++++++++++++++++++++++++++--------- 1 files changed, 29 insertions(+), 9 deletions(-) diff --git a/fence/agents/drac/fence_drac5.py b/fence/agents/drac/fence_drac5.py index 12cd5f7..cf760b0 100755 --- a/fence/agents/drac/fence_drac5.py +++ b/fence/agents/drac/fence_drac5.py @@ -1,7 +1,6 @@ #!/usr/bin/python -## -## Copyright (C) 2008 Red Hat, Inc. All Rights Reserved. +##### ## ## The Following Agent Has Been Tested On: ## @@ -10,7 +9,7 @@ ## DRAC 5 1.0 (Build 06.05.12) ## DRAC 5 1.21 (Build 07.05.04) ## -## @note: drac_version, modulename were removed +## @note: drac_version was removed ##### import sys, re, pexpect @@ -25,15 +24,22 @@ BUILD_DATE="" def get_power_status(conn, options): try: - conn.sendline("racadm serveraction powerstatus") + if options["model"] == "DRAC CMC": + conn.sendline("racadm serveraction powerstatus -m " + options["-m"]) + elif options["model"] == "DRAC 5": + conn.sendline("racadm serveraction powerstatus") + conn.log_expect(options, options["-c"], SHELL_TIMEOUT) except pexpect.EOF: fail(EC_CONNECTION_LOST) except pexpect.TIMEOUT: fail(EC_TIMED_OUT) - status = re.compile("Server power status: (.*)", re.IGNORECASE).search(conn.before).group(1) - return status.lower().strip() + status = re.compile("(^|: )(ON|OFF|Powering ON|Powering OFF)\s*$", re.IGNORECASE | re.MULTILINE).search(conn.before).group(2) + if status.lower().strip() in ["on", "powering on", "powering off"]: + return "on" + else: + return "off" def set_power_status(conn, options): action = { @@ -42,7 +48,10 @@ def set_power_status(conn, options): }[options["-o"]] try: - conn.sendline("racadm serveraction " + action) + if options["model"] == "DRAC CMC": + conn.sendline("racadm serveraction " + action + " -m " + options["-m"]) + elif options["model"] == "DRAC 5": + conn.sendline("racadm serveraction " + action) conn.log_expect(options, options["-c"], POWER_TIMEOUT) except pexpect.EOF: fail(EC_CONNECTION_LOST) @@ -52,8 +61,7 @@ def set_power_status(conn, options): def main(): device_opt = [ "help", "version", "agent", "quiet", "verbose", "debug", "action", "ipaddr", "login", "passwd", "passwd_script", - "cmd_prompt", "secure", - "drac_version", "module_name" ] + "cmd_prompt", "secure", "drac_version", "module_name" ] options = check_input(device_opt, process_input(device_opt)) @@ -67,6 +75,18 @@ def main(): ## Operate the fencing device ###### conn = fence_login(options) + + if conn.before.find("CMC") >= 0: + if 0 == options.has_key("-m") and 0 == ["monitor", "list"].count(option["-o"].lower()): + fail_usage("Failed: You have to enter module name (-m)") + + options["model"]="DRAC CMC" + elif conn.before.find("DRAC 5") >= 0: + options["model"]="DRAC 5" + else: + ## Assume this is DRAC 5 by default as we don't want to break anything + options["model"]="DRAC 5" + fence_action(conn, options, set_power_status, get_power_status) ##
reply other threads:[~2009-04-24 12:51 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090424125114.ADDC2120246@lists.fedorahosted.org \ --to=marx@fedoraproject.org \ --cc=cluster-cvs-relay@redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).