Skip to contentSkip to conversation

fencing: fix parsing issue with options which don't have short opt

PATCH New Ondrej Mular 1 participant 1 message Jun 26, 2014 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 fencing: fix parsing issue with options which don't have short opt

In reply to a message not in the archive

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(-)
fence/agents/lib/fencing.py.py +2 -1
index 5084f24..2cfa046 100644
@@ -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+"'")
Signature · 1 line
1.8.3.1