Make the error reporting back to xm just a little bit less insane, and fix a

missing import inside blkif.  Fix the command parsing for op_device_destroy and
op_device_configure -- the device IDs should be strings, to allow the user to
specify devices by name as well as number.

This is the second half to the fixes for bug #315.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
This commit is contained in:
emellor@ewan committed 2005-10-12 13:13:32 +01:00
1 parent 5ca91af2f8
commit 3e500e67eb
4 files changed
+6 -7

No files matched your search

+1 -1
View File
@@ -86,7 +86,7 @@ class SrvBase(resource.Resource):
except Exception, exn:
log.exception("Request %s failed.", op)
if req.useSxp():
return ['xend.err', "Exception: " + str(exn)]
return ['xend.err', str(exn)]
else:
return "<p>%s</p>" % str(exn)
+2 -2
View File
@@ -146,13 +146,13 @@ class SrvDomain(SrvDir):
def op_device_destroy(self, op, req):
return self.call(self.dom.destroyDevice,
[['type', 'str'],
['dev', 'int']],
['dev', 'str']],
req)
def op_device_configure(self, op, req):
return self.call(self.dom.device_configure,
[['config', 'sxpr'],
['dev', 'int']],
['dev', 'str']],
req)
+1
View File
@@ -22,6 +22,7 @@ import string
from xen.util import blkif
from xen.xend import sxp
from xen.xend.XendError import VmError
from xen.xend.server.DevController import DevController
+2 -4
View File
@@ -169,11 +169,9 @@ def handle_xend_error(cmd, dom, ex):
if error == "Not found" and dom != None:
err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
sys.exit(1)
elif error == "Exception: Device not connected":
err("Device not connected")
sys.exit(1)
else:
raise ex
err(error)
sys.exit(1)
#########################################################################
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.