KVM test: Put os.kill in kvm_stat into try block to avoid traceback
PATCH 1/1 KVM test: Put os.kill in kvm_stat into try block to avoid traceback
Sometimes it tried to kill an already terminated process which can cause a traceback. This patch fixes the problem.
Signed-off-by Yolkfull Chow <[email protected]>
--- client/profilers/kvm_stat/kvm_stat.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
client/profilers/kvm_stat/kvm_stat.py +4 -1
@@ -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):
Signature · 1 line
1.7.0.1
Lucas Meneghel Rodrigues
AppliedQuoted 2 lines · Yolkfull Chow
Sometimes it tried to kill an already terminated process which can cause a traceback. This patch fixes the problem.
Thanks, applied!
Quoted 21 lines
Signed-off-by Yolkfull Chow <[email protected]>--- client/profilers/kvm_stat/kvm_stat.py | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)client/profilers/kvm_stat/kvm_stat.py +4
-1@@ -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):