Correctly catch invalid domain lookups
PATCH 1/1 Correctly catch invalid domain lookups
# HG changeset patch
# User John Levon <[email protected]>
# 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 <[email protected]>
tools/python/xen/web/SrvDir.py +3 -1
@@ -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))