From: rmccabe@sourceware.org <rmccabe@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/apc fence_apc.py
Date: 17 Jul 2007 18:34:28 -0000 [thread overview]
Message-ID: <20070717183428.21580.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Branch: RHEL4
Changes by: rmccabe at sourceware.org 2007-07-17 18:34:28
Modified files:
fence/agents/apc: fence_apc.py
Log message:
Committing for Jim to address bz246675
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/apc/fence_apc.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.3&r2=1.1.2.4
--- cluster/fence/agents/apc/fence_apc.py 2007/02/27 16:07:59 1.1.2.3
+++ cluster/fence/agents/apc/fence_apc.py 2007/07/17 18:34:28 1.1.2.4
@@ -59,6 +59,7 @@
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."
@@ -70,9 +71,12 @@
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)
@@ -468,6 +472,7 @@
sys.exit(1)
def log_in(buffer):
+ global FIRMWARE_REV
lines = buffer.splitlines()
for i in lines:
@@ -480,6 +485,17 @@
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):
@@ -537,7 +553,12 @@
if switchnum != "":
res = switchnum + "\r"
else:
- res = "3\r"
+ 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()
@@ -639,7 +660,12 @@
if switchnum != "":
res = switchnum + "\r"
else:
- res = "3\r"
+ 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)):
@@ -660,6 +686,11 @@
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()
next reply other threads:[~2007-07-17 18:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-17 18:34 rmccabe [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-10-09 14:56 [Cluster-devel] cluster/fence/agents/apc fence_apc.py jparsons
2007-07-17 18:38 rmccabe
2007-07-12 3:45 jparsons
2007-07-12 3:39 jparsons
2007-07-11 6:37 jparsons
2007-06-27 15:10 jparsons
2007-06-27 15:03 jparsons
2007-02-27 16:07 kupcevic
2007-02-27 15:53 kupcevic
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=20070717183428.21580.qmail@sourceware.org \
--to=rmccabe@sourceware.org \
/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: link
Be 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 NNTP newsgroup(s).