Avoid spurious error when mixing a local play with remote plays depending on --ask-sudo-pass

pull/613/head
Ludovic Claude 13 years ago
parent 3c2cbae68e
commit c4303c8c04

@ -37,12 +37,12 @@ class LocalConnection(object):
''' run a command on the local host '''
if self.runner.sudo and sudoable:
cmd = "sudo -s %s" % cmd
if self.runner.sudo_pass:
# NOTE: if someone wants to add sudo w/ password to the local connection type, they are welcome
# to do so. The primary usage of the local connection is for crontab and kickstart usage however
# so this doesn't seem to be a huge priority
raise errors.AnsibleError("sudo with password is presently only supported on the paramiko (SSH) connection type")
cmd = "sudo -s %s" % cmd
p = subprocess.Popen(cmd, shell=True, stdin=None,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)

Loading…
Cancel
Save