From 19b784e48055ec750b75f21e60d49cb215f943a4 Mon Sep 17 00:00:00 2001
From: Seth Vidal <skvidal@fedoraproject.org>
Date: Fri, 9 Mar 2012 00:19:55 -0500
Subject: [PATCH] if we've failed a connection to a host - we cannot set items
 to the 'conn' object since it is not an object on failure - it's a string.

---
 lib/ansible/runner.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/ansible/runner.py b/lib/ansible/runner.py
index f0b6c596c8f..5648fd43ef8 100755
--- a/lib/ansible/runner.py
+++ b/lib/ansible/runner.py
@@ -348,10 +348,10 @@ class Runner(object):
         # module, call the appropriate executor function
 
         ok, conn = self._connect(host)
-        conn._host = host
         if not ok:
             return [ host, False, conn ]
-           
+
+        conn._host = host           
         tmp = self._get_tmp_path(conn)
         result = None
         if self.module_name not in [ 'copy', 'template' ]: