direct-io.hg

changeset 14397:b926f66f29ab

Replace tab with 4 whitespaces in xm/shutdown.py.
Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author kfraser@localhost.localdomain
date Thu Mar 15 16:54:00 2007 +0000 (2007-03-15)
parents d6ca67c0645e
children 1c94d9fcb7ef
files tools/python/xen/xm/shutdown.py
line diff
     1.1 --- a/tools/python/xen/xm/shutdown.py	Thu Mar 15 15:27:08 2007 +0000
     1.2 +++ b/tools/python/xen/xm/shutdown.py	Thu Mar 15 16:54:00 2007 +0000
     1.3 @@ -51,7 +51,7 @@ gopts.opt('reboot', short='R',
     1.4  
     1.5  def wait_reboot(opts, doms, rcs):
     1.6      if serverType == SERVER_XEN_API:
     1.7 -	    opts.err("Cannot wait for reboot w/ XenAPI (yet)")
     1.8 +        opts.err("Cannot wait for reboot w/ XenAPI (yet)")
     1.9  
    1.10      while doms:
    1.11          alive = server.xend.domains(0)
    1.12 @@ -73,7 +73,7 @@ def wait_reboot(opts, doms, rcs):
    1.13  def wait_shutdown(opts, doms):
    1.14      while doms:
    1.15          if serverType == SERVER_XEN_API:
    1.16 -		    alive = [dom for dom in server.xenapi.VM.get_all()
    1.17 +            alive = [dom for dom in server.xenapi.VM.get_all()
    1.18                       if server.xenapi.VM.get_power_state(dom) ==
    1.19                       XEN_API_VM_POWER_STATE[XEN_API_VM_POWER_STATE_RUNNING]]
    1.20          else:
    1.21 @@ -91,16 +91,16 @@ def wait_shutdown(opts, doms):
    1.22  def shutdown(opts, doms, mode, wait):
    1.23      rcs = {}
    1.24      for d in doms:
    1.25 -		if serverType == SERVER_XEN_API:
    1.26 -			if mode == 'halt':
    1.27 -				server.xenapi.VM.clean_shutdown(d)
    1.28 -			if mode == 'reboot':
    1.29 -				server.xenapi.VM.clean_reboot(d)
    1.30 -			if mode == 'poweroff':
    1.31 -				server.xenapi.VM.clean_shutdown(d)				
    1.32 -		else:
    1.33 -			rcs[d] = server.xend.domain.getRestartCount(d)
    1.34 -			server.xend.domain.shutdown(d, mode)
    1.35 +        if serverType == SERVER_XEN_API:
    1.36 +            if mode == 'halt':
    1.37 +                server.xenapi.VM.clean_shutdown(d)
    1.38 +            if mode == 'reboot':
    1.39 +                server.xenapi.VM.clean_reboot(d)
    1.40 +            if mode == 'poweroff':
    1.41 +                server.xenapi.VM.clean_shutdown(d)
    1.42 +        else:
    1.43 +            rcs[d] = server.xend.domain.getRestartCount(d)
    1.44 +            server.xend.domain.shutdown(d, mode)
    1.45  
    1.46      if wait:
    1.47          if mode == 'reboot':
    1.48 @@ -135,7 +135,7 @@ def main_dom(opts, args):
    1.49      if len(args) >  1: opts.err('No multiple domain parameters allowed')
    1.50      dom = args[0]
    1.51      if serverType == SERVER_XEN_API:
    1.52 -		dom = get_single_vm(dom)
    1.53 +        dom = get_single_vm(dom)
    1.54      mode = shutdown_mode(opts)  
    1.55      shutdown(opts, [ dom ], mode, opts.vals.wait)
    1.56