xend: 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@sun.com>
This commit is contained in:
Keir Fraser committed 2009-03-12 10:59:19 +00:00
1 parent 4696ce5d87
commit 7865c25877
1 file changed
+3 -1
+3 -1
View File
@@ -20,7 +20,7 @@ import types
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
@@ -71,6 +71,8 @@ class SrvDir(SrvBase):
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))
else:
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.