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-devel

[Xen-devel] [PATCH] Correctly catch invalid domain lookups

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] Correctly catch invalid domain lookups
From: John Levon <john.levon@xxxxxxx>
Date: Wed, 11 Mar 2009 18:42:43 -0700
Delivery-date: Wed, 11 Mar 2009 18:51:14 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User John Levon <john.levon@xxxxxxx>
# Date 1236822149 25200
# Node ID ce97fa7ee861ff3c68468715431ce2b117b5cbee
# Parent  b0afe999365ef60cc0de3dc910b52503326b5d79
Correctly catch invalid domain lookups

If a client asks about a non-existent domain, report the error back
properly instead of just backtracing within xend.

Signed-off-by: John Levon <john.levon@xxxxxxx>

diff --git a/tools/python/xen/web/SrvDir.py b/tools/python/xen/web/SrvDir.py
--- a/tools/python/xen/web/SrvDir.py
+++ b/tools/python/xen/web/SrvDir.py
@@ -20,7 +20,7 @@ from xen.xend import sxp
 from xen.xend import sxp
 from xen.xend import PrettyPrint
 from xen.xend.Args import ArgError
-from xen.xend.XendError import XendError
+from xen.xend.XendError import XendError, XendInvalidDomain
 #from xen.xend.XendLogging import log
 
 import resource
@@ -70,6 +70,8 @@ class SrvDir(SrvBase):
         try:
             val = self.get(x)
         except XendError, ex:
+            return self.noChild(str(ex))
+        except XendInvalidDomain, ex:
             return self.noChild(str(ex))
         if val is None:
             return self.noChild('Not found: ' + str(x))

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Correctly catch invalid domain lookups, John Levon <=