add in action.py kvm_shutdown_action() a verbose part
authorJens Kasten <jens@kasten-edv.de>
Tue, 10 Apr 2012 08:22:43 +0200
changeset 119 14a535ecb02d
parent 118 627b37178bae
child 120 0316dca56534
add in action.py kvm_shutdown_action() a verbose part
kvmtools/kvm/action.py
--- a/kvmtools/kvm/action.py	Tue Apr 10 07:53:40 2012 +0200
+++ b/kvmtools/kvm/action.py	Tue Apr 10 08:22:43 2012 +0200
@@ -130,7 +130,12 @@
                 # this is only usefull for init.d system 
                 # otherwise if the domain could from any reason not shutdown
                 # the whole shutdown process is blocked
-                if (timer + self.shudown_time_out) < time():
+                if self.verbose:
+                    sys.stdout.write("\t\tkilled in %0.1f seconds.\r" % \
+                        ((timer + self.shutdown_time_out) - time() - 0.05))
+                    sys.stdout.flush()
+                    
+                if (timer + self.shutdown_time_out) < (time() -0.05):
                     self.kvm_kill_action()
         else:
             print ("Could not send signal shutdown.")