From: Lucas Meneghel Rodrigues Subject: [PATCH 2/2] virt.virt_env_process: Reorganize screendump thread termination Date: Mon, 14 May 2012 20:49:35 -0300 Message-ID: <1337039375-15244-3-git-send-email-lmr@redhat.com> References: <1337039375-15244-1-git-send-email-lmr@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: autotest@test.kernel.org Return-path: In-Reply-To: <1337039375-15244-1-git-send-email-lmr@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Simplify the check for screendump termination thread event, and also avoid a bug where we try to set a delay to a None object. Fixes the following bug that happens when running the multi-disk test: Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 504, in run self.__target(*self.__args, **self.__kwargs) File "/home/lmr/Code/autotest.git/autotest/client/virt/virt_env_process.py", line 549, in _take_screendumps _screendump_thread_termination_event.wait(delay) AttributeError: 'NoneType' object has no attribute 'wait' Signed-off-by: Lucas Meneghel Rodrigues --- client/virt/virt_env_process.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py index 816e0f7..4f9e19f 100644 --- a/client/virt/virt_env_process.py +++ b/client/virt/virt_env_process.py @@ -542,8 +542,9 @@ def _take_screendumps(test, params, env): except NameError: pass os.unlink(temp_filename) - if (_screendump_thread_termination_event is not None and - _screendump_thread_termination_event.isSet()): - _screendump_thread_termination_event = None - break - _screendump_thread_termination_event.wait(delay) + + if _screendump_thread_termination_event is not None: + if _screendump_thread_termination_event.isSet(): + _screendump_thread_termination_event = None + break + _screendump_thread_termination_event.wait(delay) -- 1.7.10.1