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] Catch IOError when using local configurat

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Catch IOError when using local configuration files, to give better diagnostics.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 06 Nov 2006 16:50:36 +0000
Delivery-date: Mon, 06 Nov 2006 08:53:50 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Ewan Mellor <ewan@xxxxxxxxxxxxx>
# Node ID 29bfe8852dce2e7ff79cf1e907d8317fafd4a60c
# Parent  e793dad2114d678b9ce8ebd36145f205943bf1cb
Catch IOError when using local configuration files, to give better diagnostics.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/create.py |    3 +++
 1 files changed, 3 insertions(+)

diff -r e793dad2114d -r 29bfe8852dce tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Mon Nov 06 11:03:04 2006 +0000
+++ b/tools/python/xen/xm/create.py     Mon Nov 06 11:36:38 2006 +0000
@@ -1200,7 +1200,10 @@ def main(argv):
         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)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Catch IOError when using local configuration files, to give better diagnostics., Xen patchbot-unstable <=