All of lore.kernel.org
 help / color / mirror / Atom feed
From: jparsons@sourceware.org <jparsons@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/apc fence_apc.py
Date: 11 Jul 2007 06:37:14 -0000	[thread overview]
Message-ID: <20070711063714.666.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL5
Changes by:	jparsons at sourceware.org	2007-07-11 06:37:14

Modified files:
	fence/agents/apc: fence_apc.py 

Log message:
	Fix for bz238106 - new firmware version delta

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/apc/fence_apc.py.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.1.4.3&r2=1.1.4.4

--- cluster/fence/agents/apc/fence_apc.py	2007/06/27 15:10:27	1.1.4.3
+++ cluster/fence/agents/apc/fence_apc.py	2007/07/11 06:37:14	1.1.4.4
@@ -71,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)
@@ -469,6 +472,7 @@
         sys.exit(1)
 
 def log_in(buffer):
+  global FIRMWARE_REV
   lines = buffer.splitlines()
 
   for i in lines:
@@ -481,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):
@@ -538,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()
@@ -640,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)):
@@ -661,7 +686,12 @@
     elif i == outlet_search_str5:
       return (NOT_COMPLETE, "1\r")
     
-    elif i.find(OUTLET_CONTROL) != (-1) or i.find(OUTLET_MANAGE) != (-1):
+    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 + " "



             reply	other threads:[~2007-07-11  6:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-11  6:37 jparsons [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-17 18:34 rmccabe
2007-07-12  3:45 jparsons
2007-07-12  3:39 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=20070711063714.666.qmail@sourceware.org \
    --to=jparsons@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.