From d11262af4d0252e099464e6188c96e449acb6999 Mon Sep 17 00:00:00 2001 From: Daniel Hokka Zakrisson Date: Thu, 10 Jan 2013 22:35:03 +0100 Subject: [PATCH] Fix raw (no executable) support on -c local --- lib/ansible/runner/connection_plugins/local.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/ansible/runner/connection_plugins/local.py b/lib/ansible/runner/connection_plugins/local.py index 8589018fe0..ea8c4ff359 100644 --- a/lib/ansible/runner/connection_plugins/local.py +++ b/lib/ansible/runner/connection_plugins/local.py @@ -44,13 +44,16 @@ class Connection(object): ''' run a command on the local host ''' if not self.runner.sudo or not sudoable: - local_cmd = [ executable, '-c', cmd] + if executable: + local_cmd = [executable, '-c', cmd] + else: + local_cmd = cmd else: local_cmd, prompt = utils.make_sudo_cmd(sudo_user, executable, cmd) vvv("EXEC %s" % (local_cmd), host=self.host) p = subprocess.Popen(local_cmd, shell=isinstance(local_cmd, basestring), - cwd=self.runner.basedir, executable=executable, + cwd=self.runner.basedir, executable=executable or None, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)