WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Fix missing boolean xend config options

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Fix missing boolean xend config options
From: john.levon@xxxxxxx
Date: Wed, 31 Oct 2007 16:06:18 -0700
Delivery-date: Wed, 31 Oct 2007 16:07:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User john.levon@xxxxxxx
# 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 <john.levon@xxxxxxx>

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]))

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Fix missing boolean xend config options, john . levon <=