Revert "Update lib/ansible/utils/__init__.py"

Reported hanging of no-password sudo in some cases.  Need to explore.

This reverts commit 87f6739e20.

Conflicts:

	lib/ansible/utils/__init__.py
This commit is contained in:
Michael DeHaan 2013-01-20 09:05:07 -05:00
parent 89eee7b868
commit 35c7ebf7a4

View file

@ -569,6 +569,6 @@ def make_sudo_cmd(sudo_user, executable, cmd):
# the -p option.
randbits = ''.join(chr(random.randint(ord('a'), ord('z'))) for x in xrange(32))
prompt = '[sudo via ansible, key=%s] password: ' % randbits
sudocmd = '%s -k && %s -S -p "%s" -i -u %s %s -c %s' % (
sudocmd = '%s -k && %s -S -p "%s" -u %s %s -c %s' % (
C.DEFAULT_SUDO_EXE, C.DEFAULT_SUDO_EXE, prompt, sudo_user, executable or '$SHELL', pipes.quote(cmd))
return ('/bin/sh -c ' + pipes.quote(sudocmd), prompt)