Skip to contentSkip to conversation

KVM test: No need close session when login timeout

PATCH New Amos Kong 1 participant 1 message Dec 25, 2009 KVM

lore
Share & tools
lore

Amos Kong

author
#0 lore raw

PATCH 1/1 KVM test: No need close session when login timeout

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'"

---
 client/tests/kvm/tests/timedrift_with_migration.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
client/tests/kvm/tests/timedrift_with_migration.py +2 -1
index a012db3..0b93183 100644
@@ -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
Signature · 1 line
1.5.5.6