Gitweb: http://git.fedorahosted.org/git/fence-agents.git?p=fence-agents.git;a=commit... Commit: 89d4cfcf9bccec2299d3ce837930f1f3624522b2 Parent: eb08d9febd107f80616c3e36b3bd48e1bfe38934 Author: Arnaud Quette aquette.dev@gmail.com AuthorDate: Fri Mar 11 14:28:33 2011 +0100 Committer: Fabio M. Di Nitto fdinitto@redhat.com CommitterDate: Fri Mar 11 14:28:33 2011 +0100
eaton_snmp: fix list offset
Signed-off-by: Fabio M. Di Nitto fdinitto@redhat.com --- fence/agents/eaton_snmp/fence_eaton_snmp.py | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fence/agents/eaton_snmp/fence_eaton_snmp.py b/fence/agents/eaton_snmp/fence_eaton_snmp.py index 18df1cb..81d9810 100644 --- a/fence/agents/eaton_snmp/fence_eaton_snmp.py +++ b/fence/agents/eaton_snmp/fence_eaton_snmp.py @@ -120,9 +120,13 @@ def get_outlets_status(conn, options): for x in res_ports: t=x[0].split('.')
- port_num=((device.has_switches) and "%s:%s"%(t[len(t)-3],t[len(t)-1]) or "%s"%(t[len(t)-1])) + # Plug indexing start from zero, so we substract '1' from the + # user's given plug number + port_num=str(int(((device.has_switches) and "%s:%s"%(t[len(t)-3],t[len(t)-1]) or "%s"%(t[len(t)-1]))) + 1)
- port_name=x[1].strip('"') + # Plug indexing start from zero, so we add '1' + # for the user's exposed plug number + port_name=str(int(x[1].strip('"')) + 1) port_status="" result[port_num]=(port_name,port_status)
cluster-commits@lists.stg.fedorahosted.org