add is_running() in _get_process_info()
authorJens Kasten <jens@kasten-edv.de>
Thu, 17 May 2012 16:40:09 +0200
changeset 125 d618e5ca5698
parent 124 47e3a16e8fb1
child 126 c854d476e762
add is_running() in _get_process_info()
kvmtools/kvm/system.py
--- a/kvmtools/kvm/system.py	Tue Apr 10 10:31:01 2012 +0200
+++ b/kvmtools/kvm/system.py	Thu May 17 16:40:09 2012 +0200
@@ -78,11 +78,14 @@
 
     def _get_process_info(self):
         """Collect information from proc."""
+        self.is_running()
+        fd = None
         try:
             fd = open(os.path.join("/proc", "%d/status" % self.kvm_pid))
             lines = [line.strip().split(':') for line in fd.readlines()]
         except IOError, e:
             print "Operation failed: %s" % e
+            sys.exit(1) 
         finally:    
             if fd:
                 fd.close()