From 0d5bee2dfae9f92a093c2d240812fcc037ba5446 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Fri, 27 Apr 2012 00:46:17 -0400 Subject: [PATCH] Revert "Revert "Actually wait for password prompt in remote sudo execution. Totally breaks stderr debugging" This reverts commit e16114034c94d8e0c4b101094b2ccfd9a44de5b0. Conflicts: lib/ansible/connection.py --- examples/playbooks/group_commands.yml | 1 + lib/ansible/connection.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/examples/playbooks/group_commands.yml b/examples/playbooks/group_commands.yml index a555bc50040..363949d7fc8 100644 --- a/examples/playbooks/group_commands.yml +++ b/examples/playbooks/group_commands.yml @@ -3,6 +3,7 @@ - hosts: all user: root + sudo: True tasks: diff --git a/lib/ansible/connection.py b/lib/ansible/connection.py index 924e3a3f273..44521484ce9 100644 --- a/lib/ansible/connection.py +++ b/lib/ansible/connection.py @@ -26,6 +26,8 @@ import re import shutil import subprocess import pipes +import socket +import random from ansible import errors # prevent paramiko warning noise @@ -37,6 +39,7 @@ with warnings.catch_warnings(): ################################################ +RANDOM_PROMPT_LEN = 32 # 32 random chars in [a-z] gives > 128 bits of entropy class Connection(object):