This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fence-agents: master - fence_cisco_mds: Fix port handling


Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=a57dc167d4b8e7fb38360d95b97b4a26f09d1bae
Commit:        a57dc167d4b8e7fb38360d95b97b4a26f09d1bae
Parent:        e421362e3f6926ce6a0914dff33ffadb3d12deaf
Author:        Jan Friesse <jfriesse@redhat.com>
AuthorDate:    Tue Mar 3 16:08:21 2009 +0100
Committer:     Jan Friesse <jfriesse@redhat.com>
CommitterDate: Tue Mar 3 16:08:21 2009 +0100

fence_cisco_mds: Fix port handling

Old code calls cisco_port2oid function in case, when
no port was entered (list/monitor action). Another
bug was bad call of fail_usage.
---
 fence/agents/cisco_mds/fence_cisco_mds.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fence/agents/cisco_mds/fence_cisco_mds.py b/fence/agents/cisco_mds/fence_cisco_mds.py
index 0e18037..177c3b1 100644
--- a/fence/agents/cisco_mds/fence_cisco_mds.py
+++ b/fence/agents/cisco_mds/fence_cisco_mds.py
@@ -39,7 +39,7 @@ def cisco_port2oid(port):
 	if ((nums) and (len(nums.groups()))==2):
 		return "%s.%d.%d"%(PORT_ADMIN_STATUS_OID,int(nums.group(1))+21,int(nums.group(2))-1)
 	else:
-		fail_usage("Mangled port number: %s",port)
+		fail_usage("Mangled port number: %s"%(port))
 
 def get_power_status(conn,options):
 	global port_oid
@@ -104,7 +104,8 @@ def main():
 
 	options = check_input(device_opt, options)
 
-	port_oid=cisco_port2oid(options["-n"])
+	if (not (options["-o"] in ["list","monitor"])):
+		port_oid=cisco_port2oid(options["-n"])
 
 	# Operate the fencing device
 	fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]