public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - fence_cisco_mds: Fix port handling
@ 2009-03-03 15:13 Jan Friesse
  0 siblings, 0 replies; only message in thread
From: Jan Friesse @ 2009-03-03 15:13 UTC (permalink / raw)
  To: cluster-cvs-relay

Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=334b396a12f1e860d133b54ddcc3e8a5d2972d89
Commit:        334b396a12f1e860d133b54ddcc3e8a5d2972d89
Parent:        0d2cdf4617ed599bc2594e57b1fdbcf68693c6c5
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:12:32 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-03-03 15:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-03 15:13 cluster: STABLE3 - fence_cisco_mds: Fix port handling Jan Friesse

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 read-only IMAP folder(s) and NNTP newsgroup(s).