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-changelog

[Xen-changelog] Change boolean config option parsing to allow True and Y

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Change boolean config option parsing to allow True and Y and similar useful
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 05 Oct 2005 17:16:10 +0000
Delivery-date: Wed, 05 Oct 2005 17:13:45 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User emellor@ewan
# Node ID 6e5463aec499333e9d4f91f612981aeb1f576445
# Parent  a37a4abc11917196061b9da8bb026eac9153ef25
Change boolean config option parsing to allow True and Y and similar useful
things.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r a37a4abc1191 -r 6e5463aec499 tools/python/xen/xend/XendRoot.py
--- a/tools/python/xen/xend/XendRoot.py Wed Oct  5 16:07:01 2005
+++ b/tools/python/xen/xend/XendRoot.py Wed Oct  5 16:48:36 2005
@@ -26,6 +26,7 @@
 
 import os
 import os.path
+import string
 import sys
 
 from XendLogging import XendLogging
@@ -238,10 +239,10 @@
         return sxp.child_value(self.config, name, val=val)
 
     def get_config_bool(self, name, val=None):
-        v = self.get_config_value(name, val)
-        if v in ['yes', '1', 'on', 'true', 1, True]:
+        v = string.lower(str(self.get_config_value(name, val)))
+        if v in ['yes', 'y', '1', 'on',  'true',  't']:
             return True
-        if v in ['no', '0', 'off', 'false', 0, False]:
+        if v in ['no',  'n', '0', 'off', 'false', 'f']:
             return False
         raise XendError("invalid xend config %s: expected bool: %s" % (name, 
v))
 

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Change boolean config option parsing to allow True and Y and similar useful, Xen patchbot -unstable <=