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] [xen-unstable] merge

# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID 463bda1677151dd4b588c838a2cd2f5ad2669c82
# Parent  c630278d41933d11940e8f0893e7d11642de405f
# Parent  2773c39df9a6e3f2ca66f5f0fc0d408ced65f369
merge
---
 tools/python/xen/xend/xenstore/xstransact.py |    3 ++-
 tools/python/xen/xend/xenstore/xswatch.py    |   11 ++++++++++-
 tools/python/xen/xm/new.py                   |    6 ++++++
 3 files changed, 18 insertions(+), 2 deletions(-)

diff -r c630278d4193 -r 463bda167715 
tools/python/xen/xend/xenstore/xstransact.py
--- a/tools/python/xen/xend/xenstore/xstransact.py      Wed Nov 29 12:41:30 
2006 +0000
+++ b/tools/python/xen/xend/xenstore/xstransact.py      Wed Nov 29 12:43:11 
2006 +0000
@@ -11,11 +11,12 @@ class xstransact:
 class xstransact:
 
     def __init__(self, path = ""):
-        assert path is not None
         
         self.in_transaction = False # Set this temporarily -- if this
                                     # constructor fails, then we need to
                                     # protect __del__.
+
+        assert path is not None
         self.path = path.rstrip("/")
         self.transaction = xshandle().transaction_start()
         self.in_transaction = True
diff -r c630278d4193 -r 463bda167715 tools/python/xen/xend/xenstore/xswatch.py
--- a/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 29 12:41:30 2006 +0000
+++ b/tools/python/xen/xend/xenstore/xswatch.py Wed Nov 29 12:43:11 2006 +0000
@@ -5,6 +5,7 @@
 # Public License.  See the file "COPYING" in the main directory of
 # this archive for more details.
 
+import errno
 import threading
 from xen.xend.xenstore.xsutil import xshandle
 
@@ -65,7 +66,15 @@ def watchMain():
             watch = we[1]
             res = watch.fn(we[0], *watch.args, **watch.kwargs)
             if not res:
-                watch.unwatch()
+                try:
+                    watch.unwatch()
+                except RuntimeError, exn:
+                    if exn.args[0] == errno.ENOENT:
+                        # The watch has already been unregistered -- that's
+                        # fine.
+                        pass
+                    else:
+                        raise
         except:
             log.exception("read_watch failed")
             # Ignore this exception -- there's no point throwing it
diff -r c630278d4193 -r 463bda167715 tools/python/xen/xm/new.py
--- a/tools/python/xen/xm/new.py        Wed Nov 29 12:41:30 2006 +0000
+++ b/tools/python/xen/xm/new.py        Wed Nov 29 12:43:11 2006 +0000
@@ -58,6 +58,12 @@ def main(argv):
     if not opts:
         return
 
+    if type(config) == str:
+        try:
+            config = sxp.parse(file(config))[0]
+        except IOError, exn:
+            raise OptionError("Cannot read file %s: %s" % (config, exn[1]))
+
     if opts.vals.dryrun:
         PrettyPrint.prettyprint(config)
     else:

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

<Prev in Thread] Current Thread [Next in Thread>