Вам нужно дождаться завершения приложения, exec_command не является блокирующим вызовом.
print now(), "before call"
stdin, stdout, sterr = ssh.exec_command("sleep(10)")
print now(), "after call"
channel = stdout.channel
print now(), "before status"
status = channel.recv_exit_status()
print now(), "after status"