Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > f48a5cd9ad8f17ad8b10b2d4229901f6 > files > 126

cman-2.0.115-109.el5_9.4.src.rpm

commit 1b6691dd00e8098b429d147b52dfa0b9172f0139
Author: Marek 'marx' Grac <mgrac@redhat.com>
Date:   Fri Nov 6 15:54:59 2009 +0100

    fencing_snmp: Fix exception caused by ipport & default values
    
    This patch fixes exception in FA caused by change in fencing library:
    
    "fence agents: Option for setting port for telnet/ssh/ssl used
      by fence agent"
    
    In this branch only Cisco fence agent is affected.
    
    Resolves: bz#528916

diff --git a/fence/agents/cisco_mds/fence_cisco_mds.py b/fence/agents/cisco_mds/fence_cisco_mds.py
index 1237ec8..cd25e96 100644
--- a/fence/agents/cisco_mds/fence_cisco_mds.py
+++ b/fence/agents/cisco_mds/fence_cisco_mds.py
@@ -91,6 +91,7 @@ def main():
 
 	atexit.register(atexit_handler)
 
+	snmp_define_defaults ()
 	options=process_input(device_opt)
 
 	# Emulate enable/disable functionality
diff --git a/fence/agents/lib/fencing_snmp.py.py b/fence/agents/lib/fencing_snmp.py.py
index e3bfdc2..1fa1f07 100644
--- a/fence/agents/lib/fencing_snmp.py.py
+++ b/fence/agents/lib/fencing_snmp.py.py
@@ -12,6 +12,11 @@ REDHAT_COPYRIGHT=""
 BUILD_DATE=""
 #END_VERSION_GENERATION
 
+# Fix for RHBZ#527844
+def snmp_define_defaults ():
+	all_opt["udpport"]["default"]="161"
+	all_opt["ipport"]["default"]="161"
+
 class FencingSnmp:
 	def __init__(self,options):
 		self.options=options
@@ -68,7 +73,7 @@ class FencingSnmp:
 			force_ipvx="udp:"
 
 		cmd+=" '%s%s%s'"%(force_ipvx, self.quote_for_run(self.options["-a"]),
-				self.options.has_key("-u") and self.quote_for_run(":"+self.options["-u"]) or "")
+				self.options.has_key("-u") and self.quote_for_run(":" + str (self.options["-u"])) or "")
 		return cmd
 
 	def run_command(self,command,additional_timemout=0):