From: Ondrej Mular Date: Thu, 26 Jun 2014 06:38:43 -0400 (EDT) Subject: [Cluster-devel] [PATCH] fencing: fix parsing issue with options which don't have short opt In-Reply-To: <48424497.23419897.1403777263040.JavaMail.zimbra@redhat.com> Message-ID: <2018538866.23429088.1403779123450.JavaMail.zimbra@redhat.com> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit There was problem with options which have value, but we don't want short opt for them. In this case we can now use getopt = ":". --- fence/agents/lib/fencing.py.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py index 5084f24..2cfa046 100644 --- a/fence/agents/lib/fencing.py.py +++ b/fence/agents/lib/fencing.py.py @@ -559,7 +559,8 @@ def process_input(avail_opt): getopt_string = "" longopt_list = [] for k in avail_opt: - if all_opt.has_key(k): + if all_opt.has_key(k) and all_opt[k]["getopt"] != ":": + # getopt == ":" means that opt is without short getopt, but has value getopt_string += all_opt[k]["getopt"] else: fail_usage("Parse error: unknown option '"+k+"'") -- 1.8.3.1