Description of problem: fencing_snmp.py returns KeyError: '--a' and the fencing will fail Version-Release number of selected component (if applicable): 4.0.2 How reproducible: Always in combination of fence_intelmodular Steps to Reproduce: 1. /usr/sbin/fence_intelmodular --action=status --ip=XXX.XXX.XXX.XXX --username=snmpv3user --password=XXXXXXXXXX --snmp-version=3 --snmp-auth-prot=SHA --verbose --plug=3 --snmp-sec-level=auth Actual results: Traceback (most recent call last): File "/usr/sbin/fence_intelmodular", line 92, in <module> main() File "/usr/sbin/fence_intelmodular", line 87, in main result = fence_action(FencingSnmp(options), options, set_power_status, get_power_status, get_outlets_status) File "/usr/share/fence/fencing.py", line 810, in fence_action status = get_multi_power_fn(tn, options, get_power_fn) File "/usr/share/fence/fencing.py", line 743, in get_multi_power_fn plug_status = get_power_fn(tn, options) File "/usr/sbin/fence_intelmodular", line 41, in get_power_status (oid, status) = conn.get("%s.%s"% (STATUSES_OID, options["--plug"])) File "/usr/share/fence/fencing_snmp.py", line 106, in get cmd = "%s '%s'"% (self.prepare_cmd("snmpget"), self.quote_for_run(oid)) File "/usr/share/fence/fencing_snmp.py", line 73, in prepare_cmd cmd += " -%s '%s'"% (item[1], self.quote_for_run(self.options["--" + item[1]])) KeyError: '--a' Expected results: /usr/bin/snmpget -m '' -Oeqn -v '3' -a 'SHA' -l 'auth' -A '87654321' -u 'snmpv3user' '85.17.234.138:161' '.1.3.6.1.4.1.343.2.19.1.2.10.202.1.1.6.3' .1.3.6.1.4.1.343.2.19.1.2.10.202.1.1.6.3 2 Status: ON Additional info: I have found the bug, but can't know if it will affect other snmp fencing. But the correction is logic trough my eyes in the file fencing_snmp.py on line 73 it states: cmd += " -%s '%s'"% (item[1], self.quote_for_run(self.options["--" + item[1]])) And it need to be: cmd += " -%s '%s'"% (item[1], self.quote_for_run(self.options["--" + item[0]])) I have attached the corrected file
Created attachment 788626 [details] corrected file This the corrected file.
Thanks for reporting, fix is in upstream now. But are you sure that this happends in RHEL 6.x ? Should it be reported against upstream?
Hi Marec, No you are totaly right. It was Fedora. I was confused and mixed my RHE servers with my test servers. Sorry, my excuse! How did I need to report it? So I can't make this mistake again.
@Tim: No problem, I'm also upstream and Fedora maintainer so I have to do it anyway. Next time, just report it against Fedora.