[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] Fix Xend domain_lookup error report when looking up an invalid



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Date 1172756911 0
# Node ID 780ef7701772f95205a5f08c4846b3dff5dc6b7a
# Parent  035d41b6c94c9449e97a066fa756d0f2e172f76b
Fix Xend domain_lookup error report when looking up an invalid
domain: raise the correct error code (XendInvalidDomain instead of
XendError). Also remove redundance exception code that is handled by
domain_lookup.

Signed-off-by: Yung Giang <ygiang@xxxxxxxxx>
---
 tools/python/xen/xend/XendDomain.py          |    4 ++--
 tools/python/xen/xend/server/SrvDomainDir.py |    2 --
 tools/python/xen/xend/server/XMLRPCServer.py |    2 --
 3 files changed, 2 insertions(+), 6 deletions(-)

diff -r 035d41b6c94c -r 780ef7701772 tools/python/xen/xend/XendDomain.py
--- a/tools/python/xen/xend/XendDomain.py       Thu Mar 01 13:45:53 2007 +0000
+++ b/tools/python/xen/xend/XendDomain.py       Thu Mar 01 13:48:31 2007 +0000
@@ -488,14 +488,14 @@ class XendDomain:
         @type domid: int or string
         @return: Found domain.
         @rtype: XendDomainInfo
-        @raise XendError: If domain is not found.
+        @raise XendInvalidDomain: If domain is not found.
         """
         self.domains_lock.acquire()
         try:
             self._refresh(refresh_shutdown = False)
             dom = self.domain_lookup_nr(domid)
             if not dom:
-                raise XendError("No domain named '%s'." % str(domid))
+                raise XendInvalidDomain("No domain named '%s'." % str(domid))
             return dom
         finally:
             self.domains_lock.release()
diff -r 035d41b6c94c -r 780ef7701772 
tools/python/xen/xend/server/SrvDomainDir.py
--- a/tools/python/xen/xend/server/SrvDomainDir.py      Thu Mar 01 13:45:53 
2007 +0000
+++ b/tools/python/xen/xend/server/SrvDomainDir.py      Thu Mar 01 13:48:31 
2007 +0000
@@ -42,8 +42,6 @@ class SrvDomainDir(SrvDir):
 
     def domain(self, x):
         dom = self.xd.domain_lookup(x)
-        if not dom:
-            raise XendError('No such domain ' + str(x))
         return SrvDomain(dom)
 
     def get(self, x):
diff -r 035d41b6c94c -r 780ef7701772 
tools/python/xen/xend/server/XMLRPCServer.py
--- a/tools/python/xen/xend/server/XMLRPCServer.py      Thu Mar 01 13:45:53 
2007 +0000
+++ b/tools/python/xen/xend/server/XMLRPCServer.py      Thu Mar 01 13:48:31 
2007 +0000
@@ -43,8 +43,6 @@ def fixup_sxpr(sexpr):
 
 def lookup(domid):
     info = XendDomain.instance().domain_lookup(domid)
-    if not info:
-        raise XendInvalidDomain(str(domid))
     return info
 
 def dispatch(domid, fn, args):

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.