diff mbox

KVM Test: Make sar profiler could work in python 2.4

Message ID 1271057713-32104-1-git-send-email-fyang@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Feng Yang April 12, 2010, 7:35 a.m. UTC
None
diff mbox

Patch

diff --git a/client/profilers/sar/sar.py b/client/profilers/sar/sar.py
index 2618646..7ee28b3 100644
--- a/client/profilers/sar/sar.py
+++ b/client/profilers/sar/sar.py
@@ -41,8 +41,8 @@  class sar(profiler.profiler):
         else:
             # Sar process didn't return, so 0 means generate continuously
             # Just terminate the process
-            self.cmd = self.sar_path + "-o %s %d 0"
-            t_process.terminate()
+            self.cmd = self.sar_path + " -o %s %d 0"
+            os.kill(t_process.pid, 15)
 
 
     def start(self, test):
@@ -65,8 +65,10 @@  class sar(profiler.profiler):
 
         @param test: Autotest test on which this profiler will operate on.
         """
-        self.sar_process.terminate()
-
+        try:
+            os.kill(self.sar_process.pid, 15)
+        except OSError:
+            pass
 
     def report(self, test):
         """