cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Ondrej Mular <omular@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [PATCH] fencing: fix parsing issue with options which don't have short opt
Date: Thu, 26 Jun 2014 06:38:43 -0400 (EDT)	[thread overview]
Message-ID: <2018538866.23429088.1403779123450.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <48424497.23419897.1403777263040.JavaMail.zimbra@redhat.com>

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



           reply	other threads:[~2014-06-26 10:38 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <48424497.23419897.1403777263040.JavaMail.zimbra@redhat.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2018538866.23429088.1403779123450.JavaMail.zimbra@redhat.com \
    --to=omular@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).