KVM test: migration subtest: Handle case where session2 does not exist

In one of the code blocks of the migration test, a finally
clause tries to send a command to a session. However, if we
are not successful in actually creating a session, that
object will hold None, which doesn't have an is_alive attribute,
generating an unhandled exception. Fix that by checking
if the session2 object is not None before trying to use the
method is_alive()

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@3949 592f7852-d20e-0410-864c-8624ca9c26a4
1 file changed