ia64/xen-unstable

changeset 12659:463bda167715

merge
author kfraser@localhost.localdomain
date Wed Nov 29 12:43:11 2006 +0000 (2006-11-29)
parents c630278d4193 2773c39df9a6
children d8c32fa3e3a9 5e9812e53300
files
line diff
     1.1 --- a/tools/python/xen/xend/xenstore/xstransact.py	Wed Nov 29 12:41:30 2006 +0000
     1.2 +++ b/tools/python/xen/xend/xenstore/xstransact.py	Wed Nov 29 12:43:11 2006 +0000
     1.3 @@ -11,11 +11,12 @@ from xen.xend.xenstore.xsutil import xsh
     1.4  class xstransact:
     1.5  
     1.6      def __init__(self, path = ""):
     1.7 -        assert path is not None
     1.8          
     1.9          self.in_transaction = False # Set this temporarily -- if this
    1.10                                      # constructor fails, then we need to
    1.11                                      # protect __del__.
    1.12 +
    1.13 +        assert path is not None
    1.14          self.path = path.rstrip("/")
    1.15          self.transaction = xshandle().transaction_start()
    1.16          self.in_transaction = True
     2.1 --- a/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 29 12:41:30 2006 +0000
     2.2 +++ b/tools/python/xen/xend/xenstore/xswatch.py	Wed Nov 29 12:43:11 2006 +0000
     2.3 @@ -5,6 +5,7 @@
     2.4  # Public License.  See the file "COPYING" in the main directory of
     2.5  # this archive for more details.
     2.6  
     2.7 +import errno
     2.8  import threading
     2.9  from xen.xend.xenstore.xsutil import xshandle
    2.10  
    2.11 @@ -65,7 +66,15 @@ def watchMain():
    2.12              watch = we[1]
    2.13              res = watch.fn(we[0], *watch.args, **watch.kwargs)
    2.14              if not res:
    2.15 -                watch.unwatch()
    2.16 +                try:
    2.17 +                    watch.unwatch()
    2.18 +                except RuntimeError, exn:
    2.19 +                    if exn.args[0] == errno.ENOENT:
    2.20 +                        # The watch has already been unregistered -- that's
    2.21 +                        # fine.
    2.22 +                        pass
    2.23 +                    else:
    2.24 +                        raise
    2.25          except:
    2.26              log.exception("read_watch failed")
    2.27              # Ignore this exception -- there's no point throwing it
     3.1 --- a/tools/python/xen/xm/new.py	Wed Nov 29 12:41:30 2006 +0000
     3.2 +++ b/tools/python/xen/xm/new.py	Wed Nov 29 12:43:11 2006 +0000
     3.3 @@ -58,6 +58,12 @@ def main(argv):
     3.4      if not opts:
     3.5          return
     3.6  
     3.7 +    if type(config) == str:
     3.8 +        try:
     3.9 +            config = sxp.parse(file(config))[0]
    3.10 +        except IOError, exn:
    3.11 +            raise OptionError("Cannot read file %s: %s" % (config, exn[1]))
    3.12 +
    3.13      if opts.vals.dryrun:
    3.14          PrettyPrint.prettyprint(config)
    3.15      else: