fence-agents: master - fencing: Fix problems with options without short getopt

Marek GrĂ¡c marx at fedoraproject.org
Thu Jun 26 14:04:18 UTC 2014


Gitweb:        http://git.fedorahosted.org/git/?p=fence-agents.git;a=commitdiff;h=2b80f70df2e225492e96b592ffca690046a9e6f7
Commit:        2b80f70df2e225492e96b592ffca690046a9e6f7
Parent:        d27c5cc8fcf108ee8eb5b434df898ee2137fbaf2
Author:        Marek 'marx' Grac <mgrac at redhat.com>
AuthorDate:    Thu Jun 26 16:02:24 2014 +0200
Committer:     Marek 'marx' Grac <mgrac at redhat.com>
CommitterDate: Thu Jun 26 16:02:24 2014 +0200

fencing: Fix problems with options without short getopt

---
 fence/agents/lib/fencing.py.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 0584b7e..4520ea8 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -559,9 +559,10 @@ 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:
+		elif not all_opt.has_key(k):
 			fail_usage("Parse error: unknown option '"+k+"'")
 
 		if all_opt.has_key(k) and all_opt[k].has_key("longopt"):


More information about the cluster-commits mailing list