From: john.levon@sun.com Subject: [PATCH] Fix missing boolean xend config options Date: Wed, 31 Oct 2007 16:06:18 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User john.levon@sun.com # Date 1193871970 25200 # Node ID adbe1cac902262376f8af907e36d35cbf0292f89 # Parent d6a5c302e13680fceb473a25dce818ecee9e930e Fix missing boolean xend config options If a boolean option was missing in the SCF database, we weren't processing the default value correctly. Signed-off-by: John Levon diff --git a/tools/python/xen/xend/XendOptions.py b/tools/python/xen/xend/XendOptions.py --- a/tools/python/xen/xend/XendOptions.py +++ b/tools/python/xen/xend/XendOptions.py @@ -386,6 +386,10 @@ if os.uname()[0] == 'SunOS': return scf.get_bool(name) except scf.error, e: if e[0] == scf.SCF_ERROR_NOT_FOUND: + if val in ['yes', 'y', '1', 'on', 'true', 't']: + return True + if val in ['no', 'n', '0', 'off', 'false', 'f']: + return False return val else: raise XendError("option %s: %s:%s" % (name, e[1], e[2]))