public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] KVM test: Put os.kill in kvm_stat into try block to avoid traceback
@ 2010-03-29  9:56 Yolkfull Chow
  2010-03-29 14:04 ` Lucas Meneghel Rodrigues
  0 siblings, 1 reply; 2+ messages in thread
From: Yolkfull Chow @ 2010-03-29  9:56 UTC (permalink / raw)
  To: autotest; +Cc: kvm

Sometimes it tried to kill an already terminated process which can cause
a traceback. This patch fixes the problem.

Signed-off-by: Yolkfull Chow <yzhou@redhat.com>
---
 client/profilers/kvm_stat/kvm_stat.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/client/profilers/kvm_stat/kvm_stat.py b/client/profilers/kvm_stat/kvm_stat.py
index 7568a03..59d6ff6 100644
--- a/client/profilers/kvm_stat/kvm_stat.py
+++ b/client/profilers/kvm_stat/kvm_stat.py
@@ -51,7 +51,10 @@ class kvm_stat(profiler.profiler):
 
         @param test: Autotest test on which this profiler will operate on.
         """
-        os.kill(self.pid, 15)
+        try:
+            os.kill(self.pid, 15)
+        except OSError:
+            pass
 
 
     def report(self, test):
-- 
1.7.0.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-29 14:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29  9:56 [PATCH] KVM test: Put os.kill in kvm_stat into try block to avoid traceback Yolkfull Chow
2010-03-29 14:04 ` Lucas Meneghel Rodrigues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox