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] Move exception handler for sxp.ParseError above that for

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Move exception handler for sxp.ParseError above that for Exception, as the
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 26 Oct 2005 17:24:06 +0000
Delivery-date: Wed, 26 Oct 2005 17:21: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 emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 0240a69e1f97845145b377f95e68b16d52660221
# Parent  98fd1359eecdeb58174b52e6339ea35e55022a13
Move exception handler for sxp.ParseError above that for Exception, as the
latter subsumes the former.  Minor tidy-ups.

Signed-off-by: Ewan Mellor <ewan@xxxxxxxxxxxxx>

diff -r 98fd1359eecd -r 0240a69e1f97 
tools/python/xen/xend/server/SrvDomainDir.py
--- a/tools/python/xen/xend/server/SrvDomainDir.py      Wed Oct 26 13:58:13 2005
+++ b/tools/python/xen/xend/server/SrvDomainDir.py      Wed Oct 26 13:59:29 2005
@@ -25,7 +25,6 @@
 from xen.xend.XendDomainInfo import XendDomainInfo
 from xen.xend.Args import FormFn
 from xen.xend.XendError import XendError
-from xen.xend.XendLogging import log
 
 from xen.web.SrvDir import SrvDir
 from SrvDomain import SrvDomain
@@ -52,7 +51,7 @@
         else:
             return self.domain(x)
 
-    def op_create(self, op, req):
+    def op_create(self, _, req):
         """Create a domain.
         Expects the domain config in request parameter 'config' in SXP format.
         """
@@ -66,12 +65,12 @@
             pin.input_eof()
             config = pin.get_val()
             ok = 1
+        except sxp.ParseError, ex:
+            errmsg = 'Invalid configuration ' + str(ex)
         except Exception, ex:
             print 'op_create> Exception in config', ex
             traceback.print_exc()
             errmsg = 'Configuration error ' + str(ex)
-        except sxp.ParseError, ex:
-            errmsg = 'Invalid configuration ' + str(ex)
         if not ok:
             raise XendError(errmsg)
         try:
@@ -108,7 +107,7 @@
         """
         return req.threadRequest(self.do_restore, op, req)
 
-    def do_restore(self, op, req):
+    def do_restore(self, _, req):
         fn = FormFn(self.xd.domain_restore,
                     [['file', 'str']])
         dominfo = fn(req.args)

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Move exception handler for sxp.ParseError above that for Exception, as the, Xen patchbot -unstable <=