fence-agents: master - fencing: accept only options used in fence-agent

Marek GrĂ¡c marx at fedoraproject.org
Wed Feb 26 15:15:02 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=ed6ed4c4f8e5142457a2fabb4385d7d75209196d
Commit:        ed6ed4c4f8e5142457a2fabb4385d7d75209196d
Parent:        dc7509aa2e1b67bbce9bebe58c027e85944f8b96
Author:        Ondrej Mular <omular at redhat.com>
AuthorDate:    Fri Feb 21 07:03:23 2014 -0500
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Wed Feb 26 15:39:31 2014 +0100

fencing: accept only options used in fence-agent

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index b8aa98f..2006f0d 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -572,7 +572,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]


More information about the cluster-commits mailing list