[Cluster-devel] [PATCH 1/2] fencing: accept only options used in fence-agent

Ondrej Mular omular at redhat.com
Fri Feb 21 12:03:23 UTC 2014


In transformation from short options to long options, was used list of all options. That caused collision of options if there was 2 options with same short name, but only one was used in fence-agent.

---
 fence/agents/lib/fencing.py.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 889bb04..8f214d7 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -563,7 +563,7 @@ def process_input(avail_opt):
 						opt["--" + all_opt[x]["longopt"]] = dict(old_opt)[o]
 			else:
 				for x in all_opt.keys():
-					if all_opt[x].has_key("getopt") and all_opt[x].has_key("longopt") and \
+					if x in avail_opt and all_opt[x].has_key("getopt") and all_opt[x].has_key("longopt") and \
 						("-" + all_opt[x]["getopt"] == o or "-" + all_opt[x]["getopt"].rstrip(":") == o):
 						opt["--" + all_opt[x]["longopt"]] = dict(old_opt)[o]
 				opt[o] = dict(old_opt)[o]
-- 
1.8.3.1




More information about the Cluster-devel mailing list