Gitweb: http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=ce7859f3a... Commit: ce7859f3a34d76aaa8cb7361e7996c419904bc67 Parent: 0199cc9a5add0b4d3a6b0da1a5dcacba2539d232 Author: Marek 'marx' Grac mgrac@redhat.com AuthorDate: Mon Jul 23 11:24:43 2012 +0200 Committer: Marek 'marx' Grac mgrac@redhat.com CommitterDate: Thu Oct 4 10:49:03 2012 +0200
fence_ipdu: Minor fixes to fence agent
* replace code to use 'default' value * remove code for backward compatibility with old options (-n switch:port)
Resolves: rhbz#740869 --- fence/agents/ipdu/fence_ipdu.py | 13 ++----------- 1 files changed, 2 insertions(+), 11 deletions(-)
diff --git a/fence/agents/ipdu/fence_ipdu.py b/fence/agents/ipdu/fence_ipdu.py index 9c135e6..aac0b7d 100644 --- a/fence/agents/ipdu/fence_ipdu.py +++ b/fence/agents/ipdu/fence_ipdu.py @@ -49,7 +49,7 @@ def ipdu_set_device(conn,options): agents_dir={'.1.3.6.1.4.1.2.6.223':IBMiPDU, None:IBMiPDU}
- # First resolve type of APC + # First resolve type of PDU device pdu_type=conn.walk(OID_SYS_OBJECT_ID)
if (not ((len(pdu_type)==1) and (agents_dir.has_key(pdu_type[0][1])))): @@ -133,6 +133,7 @@ def get_outlets_status(conn, options): def ipdu_snmp_define_defaults(): all_opt["snmp_version"]["default"]="3" all_opt["community"]["default"]="private" + all_opt["switch"]["default"]="1" device=IBMiPDU
# Main agent method @@ -152,16 +153,6 @@ def main():
options=check_input(device_opt,process_input(device_opt))
- ## Support for -n [switch]:[plug] notation that was used before - if ((options.has_key("-n")) and (-1 != options["-n"].find(":"))): - (switch, plug) = options["-n"].split(":", 1) - if ((switch.isdigit()) and (plug.isdigit())): - options["-s"] = switch - options["-n"] = plug - - if (not (options.has_key("-s"))): - options["-s"]="1" - docs = { } docs["shortdesc"] = "Fence agent for iPDU over SNMP" docs["longdesc"] = "fence_ipdu is an I/O Fencing agent \
cluster-commits@lists.stg.fedorahosted.org