Tweaks on previous refactoring of playbook, version bump a 0.4 reference, remove some debug, etc

This commit is contained in:
Michael DeHaan
2012-05-26 01:20:53 -04:00
parent b9b53d1941
commit ecb944892d
6 changed files with 27 additions and 27 deletions

View File

@@ -549,6 +549,9 @@ class Runner(object):
return ReturnData(host=conn.host, comm_ok=False, result=result)
if self.module_vars is not None:
inject.update(self.module_vars)
source = utils.template(source, inject, self.setup_cache)
#(host, ok, data, err) = (None, None, None, None)

View File

@@ -42,15 +42,13 @@ with warnings.catch_warnings():
class Connection(object):
''' Handles abstract connections to remote hosts '''
_LOCALHOSTRE = re.compile(r"^(127.0.0.1|localhost|%s)$" % os.uname()[1])
def __init__(self, runner, transport,sudo_user):
self.runner = runner
self.transport = transport
self.sudo_user = sudo_user
def connect(self, host, port=None):
conn = None
if self.transport == 'local' and self._LOCALHOSTRE.search(host):
if self.transport == 'local':
conn = LocalConnection(self.runner, host)
elif self.transport == 'paramiko':
conn = ParamikoConnection(self.runner, host, port)