From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amos Kong Subject: [Autotest PATCH] KVM test: No need close session when login timeout Date: Fri, 25 Dec 2009 15:32:32 +0800 Message-ID: <1261726352-6145-1-git-send-email-akong@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: 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 If login timeout, wait_for() returned 'None' and assigned to 'session'. When call session.close(), this prlblem was caused: "AttributeError: 'NoneType' object has no attribute 'close'" Signed-off-by: Amos Kong --- client/tests/kvm/tests/timedrift_with_migration.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/tests/timedrift_with_migration.py b/client/tests/kvm/tests/timedrift_with_migration.py index a012db3..0b93183 100644 --- a/client/tests/kvm/tests/timedrift_with_migration.py +++ b/client/tests/kvm/tests/timedrift_with_migration.py @@ -76,7 +76,8 @@ def run_timedrift_with_migration(test, params, env): time_filter_re, time_format) finally: - session.close() + if session != None: + session.close() # Report results host_delta = ht1 - ht0 -- 1.5.5.6