All of lore.kernel.org
 help / color / mirror / Atom feed
From: kupcevic@sourceware.org <kupcevic@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/fence/agents/apc fence_apc_snmp.py
Date: 14 Feb 2007 16:23:21 -0000	[thread overview]
Message-ID: <20070214162321.6619.qmail@sourceware.org> (raw)

CVSROOT:	/cvs/cluster
Module name:	cluster
Branch: 	RHEL4
Changes by:	kupcevic at sourceware.org	2007-02-14 16:23:21

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

Log message:
	fence_apc_snmp ignores "port" parameter

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/fence/agents/apc/fence_apc_snmp.py.diff?cvsroot=cluster&only_with_tag=RHEL4&r1=1.1.2.2&r2=1.1.2.3

--- cluster/fence/agents/apc/fence_apc_snmp.py	2006/08/09 19:17:26	1.1.2.2
+++ cluster/fence/agents/apc/fence_apc_snmp.py	2007/02/14 16:23:21	1.1.2.3
@@ -17,7 +17,7 @@
 ## located in /usr/share/snmp/mibs/
 #############################################################################
 #############################################################################
-                                                                                
+
 
 
 import getopt, sys
@@ -50,7 +50,7 @@
         print "  -q               quiet mode";
         print "  -V               version";
         print "  -v               Log to file /tmp/apclog";
-                                                                                
+	
         sys.exit(0);
 
 
@@ -89,7 +89,7 @@
         sys.exit(0)
       if o in ("-h", "--help"):
         usage()
-        sys.exit()
+        sys.exit(0)
       if o == "-n":
         port = a
       if o  == "-o":
@@ -123,8 +123,9 @@
     #place params in dict
     for line in sys.stdin:
       val = line.split("=")
-      params[val[0]] = val[1]
-
+      if len(val) == 2:
+        params[val[0].strip()] = val[1].strip()
+    
     try:
       address = params["ipaddr"]
     except KeyError, e:
@@ -135,13 +136,20 @@
     except KeyError, e:
       sys.stderr.write("FENCE: Missing login param for fence_apc...exiting")
       sys.exit(1)
-                                                                                
+    
     try:
       passwd = params["passwd"]
     except KeyError, e:
       sys.stderr.write("FENCE: Missing passwd param 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:
       a = params["option"]
       if a == "Off" or a == "OFF" or a == "off":
@@ -300,13 +308,13 @@
         sys.exit(1)
         
 def execWithCaptureStatus(command, argv, searchPath = 0, root = '/', stdin = 0,
-                    catchfd = 1, closefd = -1):
-                                                                                
+			  catchfd = 1, closefd = -1):
+	
     if not os.access (root + command, os.X_OK):
-        raise RuntimeError, command + " can not be run"
-                                                                                
+        raise RuntimeError, command + " cannot be run"
+    
     (read, write) = os.pipe()
-                                                                                
+    
     childpid = os.fork()
     if (not childpid):
         if (root and root != '/'): os.chroot (root)
@@ -317,42 +325,42 @@
             os.dup2(write, catchfd)
         os.close(write)
         os.close(read)
-                                                                                
+	
         if closefd != -1:
             os.close(closefd)
-                                                                                
+	
         if stdin:
             os.dup2(stdin, 0)
             os.close(stdin)
-                                                                                
+	
         if (searchPath):
             os.execvp(command, argv)
         else:
             os.execv(command, argv)
-                                                                                
+	
         sys.exit(1)
-                                                                                
+    
     os.close(write)
-                                                                                
+    
     rc = ""
     s = "1"
     while (s):
         select.select([read], [], [])
         s = os.read(read, 1000)
         rc = rc + s
-                                                                                
+    
     os.close(read)
-                                                                                
+    
     try:
         (pid, status) = os.waitpid(childpid, 0)
     except OSError, (errno, msg):
         print __name__, "waitpid:", msg
-                                                                                
+    
     if os.WIFEXITED(status) and (os.WEXITSTATUS(status) == 0):
         status = os.WEXITSTATUS(status)
     else:
         status = -1
-                                                                                
+    
     return (rc, status)
 
 if __name__ == "__main__":



             reply	other threads:[~2007-02-14 16:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14 16:23 kupcevic [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-02-14  9:37 [Cluster-devel] cluster/fence/agents/apc fence_apc_snmp.py kupcevic
2006-08-09 19:22 jparsons
2006-08-09 19:17 jparsons

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=20070214162321.6619.qmail@sourceware.org \
    --to=kupcevic@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.