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:
Ewan Mellor committed 2007-03-20 17:36:18 +00:00
1 parent 5ce79470d8
commit 5b3327347f
1 file changed
+2 -1
+2 -1
View File
@@ -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')
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.