Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > d236c5da97a239a1b6991cfba2865b66 > files > 67

cman-2.0.115-68.el5_6.1.src.rpm

From c57d8c5a6b3ba804a0d3242fdbd9daeb9476b58d Mon Sep 17 00:00:00 2001
From: Marek 'marx' Grac <mgrac@redhat.com>
Date: Tue, 20 Apr 2010 12:27:47 +0200
Subject: [PATCH] fencing: Creating manual pages fails when default value is a list

Problem was concatenating string + list in python. Lists can't be
entered using command line or stdin.

Resolves: rhbz#583053
---
 fence/agents/lib/fencing.py.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fence/agents/lib/fencing.py.py b/fence/agents/lib/fencing.py.py
index 0128a20..585baa1 100644
--- a/fence/agents/lib/fencing.py.py
+++ b/fence/agents/lib/fencing.py.py
@@ -434,7 +434,7 @@ def metadata(avail_opt, options, docs):
 
 			default = ""
 			if all_opt[option].has_key("default"):
-				default = "default=\""+all_opt[option]["default"]+"\""
+				default = "default=\""+str(all_opt[option]["default"])+"\""
 			elif options.has_key("-" + all_opt[option]["getopt"][:-1]):
 				if options["-" + all_opt[option]["getopt"][:-1]]:
 					try:
@@ -442,7 +442,7 @@ def metadata(avail_opt, options, docs):
 					except TypeError:
 						## @todo/@note: Currently there is no clean way how to handle lists
 						## we can create a string from it but we can't set it on command line
-						default = "default=\"list of values\""
+						default = "default=\"" + str(options["-" + all_opt[option]["getopt"][:-1]]) +"\""
 			elif options.has_key("-" + all_opt[option]["getopt"]):
 				default = "default=\"true\" "
 
-- 
1.6.0.6