fence-agents: master - fence_eaton_snmp: fix port number handling

Fabio M. Di Nitto fabbione at fedoraproject.org
Fri Feb 25 08:48:30 UTC 2011


Gitweb:        http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commitdiff;h=5bee71f95ec9f1c6a1486fe7f16ddeda32865b1d
Commit:        5bee71f95ec9f1c6a1486fe7f16ddeda32865b1d
Parent:        693d93c73fb6cd4a7978a507f0fce33c85feda6f
Author:        Fabio M. Di Nitto <fdinitto at redhat.com>
AuthorDate:    Fri Feb 25 09:46:34 2011 +0100
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Fri Feb 25 09:46:34 2011 +0100

fence_eaton_snmp: fix port number handling

snmp port enumration starts at 0 while all other interfaces start at 1.

Make the numbering consistent between configuration, devices and UIs.

Signed-off-by: Arnaud Quette <aquette.dev at gmail.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto at redhat.com>
---
 fence/agents/eaton_snmp/fence_eaton_snmp.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py
index b02cfd1..18df1cb 100644
--- a/fence/agents/eaton_snmp/fence_eaton_snmp.py
+++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py
@@ -160,6 +160,11 @@ def main():
 	if (not (options.has_key("-s"))):
 		options["-s"]="1"
 
+	# Plug indexing start from zero, so we substract '1' from the
+	# user's given plug number
+	if ((options.has_key("-n")) and (options["-n"].isdigit())):
+		options["-n"] = str(int(options["-n"]) - 1)
+
 	docs = { }
 	docs["shortdesc"] = "Fence agent for Eaton over SNMP"
 	docs["longdesc"] = "fence_eaton_snmp is an I/O Fencing agent \


More information about the cluster-commits mailing list