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] Support removing nodes from store if value to store is N

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Support removing nodes from store if value to store is None.
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 14 Sep 2005 19:58:11 +0000
Delivery-date: Wed, 14 Sep 2005 19:56:48 +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 cl349@xxxxxxxxxxxxxxxxxxxx
# Node ID 960d4f6b58b3fb4d3dab82f98254fa3e6bcbe52a
# Parent  f92bdd9153f54583512635ced9d5a8812233f29e
Support removing nodes from store if value to store is None.
Signed-off-by: Christian Limpach <Christian.Limpach@xxxxxxxxxxxx>

diff -r f92bdd9153f5 -r 960d4f6b58b3 
tools/python/xen/xend/xenstore/xstransact.py
--- a/tools/python/xen/xend/xenstore/xstransact.py      Wed Sep 14 19:22:31 2005
+++ b/tools/python/xen/xend/xenstore/xstransact.py      Wed Sep 14 19:29:25 2005
@@ -113,7 +113,7 @@
             else:
                 (key, fn, defval) = tup
             try:
-                val = fn(self.read(key))
+                val = fn(self._read(key))
             except TypeError:
                 val = defval
             ret.append(val)
@@ -128,12 +128,16 @@
                 try:
                     fmt = { str : "%s",
                             int : "%i",
-                            float : "%f" }[type(val)]
+                            float : "%f",
+                            type(None) : None }[type(val)]
                 except KeyError:
                     raise TypeError
             else:
                 (key, val, fmt) = tup
-            self.write(key, fmt % val)
+            if val:
+                self._write(key, fmt % val)
+            else:
+                self._remove(key)
 
 
     def Read(cls, path, *args):

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Support removing nodes from store if value to store is None., Xen patchbot -unstable <=