mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 18:21:39 +01:00
Raise an exception in xm_block_detach if using Xen-API and it fails -- this
ensures that the exit status properly set. Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
This commit is contained in:
1 parent
5ce79470d8
commit
5b3327347f
1 file changed
+2
-1
@@ -1962,7 +1962,8 @@ def xm_block_detach(args):
|
||||
if len(server.xenapi.VDI.get_VBDs(vdi_ref)) <= 0:
|
||||
server.xenapi.VDI.destroy(vdi_ref)
|
||||
else:
|
||||
print "Cannot find device '%s' in domain '%s'" % (dev,dom)
|
||||
raise OptionError("Cannot find device '%s' in domain '%s'"
|
||||
% (dev,dom))
|
||||
else:
|
||||
try:
|
||||
detach(args, 'block-detach', 'vbd')
|
||||
|
||||