From: John Levon Subject: [PATCH] Correctly catch invalid domain lookups Date: Wed, 11 Mar 2009 18:42:43 -0700 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User John Levon # 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 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))