ia64/xen-unstable

changeset 14493:3fd9b0c71b8c

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>
author Ewan Mellor <ewan@xensource.com>
date Tue Mar 20 17:36:18 2007 +0000 (2007-03-20)
parents 92f14ace389c
children 2216a45bf058 f1833268b28f 49ec3725d0c0
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Mar 20 17:34:34 2007 +0000
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Mar 20 17:36:18 2007 +0000
     1.3 @@ -1962,7 +1962,8 @@ def xm_block_detach(args):
     1.4              if len(server.xenapi.VDI.get_VBDs(vdi_ref)) <= 0:
     1.5                  server.xenapi.VDI.destroy(vdi_ref)
     1.6          else:
     1.7 -            print "Cannot find device '%s' in domain '%s'" % (dev,dom)
     1.8 +            raise OptionError("Cannot find device '%s' in domain '%s'"
     1.9 +                              % (dev,dom))
    1.10      else:
    1.11          try:
    1.12              detach(args, 'block-detach', 'vbd')