direct-io.hg

changeset 12247:29bfe8852dce

Catch IOError when using local configuration files, to give better diagnostics.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Nov 06 11:36:38 2006 +0000 (2006-11-06)
parents e793dad2114d
children b2668cc03914
files tools/python/xen/xm/create.py
line diff
     1.1 --- a/tools/python/xen/xm/create.py	Mon Nov 06 11:03:04 2006 +0000
     1.2 +++ b/tools/python/xen/xm/create.py	Mon Nov 06 11:36:38 2006 +0000
     1.3 @@ -1200,7 +1200,10 @@ def main(argv):
     1.4          return
     1.5  
     1.6      if type(config) == str:
     1.7 +        try:
     1.8              config = sxp.parse(file(config))[0]
     1.9 +        except IOError, exn:
    1.10 +            raise OptionError("Cannot read file %s: %s" % (config, exn[1]))
    1.11  
    1.12      if opts.vals.dryrun:
    1.13          PrettyPrint.prettyprint(config)