diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 0be80a07a2..40bf078842 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -32,11 +32,11 @@ import getpass import codecs import ansible.constants as C -import connection import ansible.inventory from ansible import utils from ansible import errors -from ansible.runner import poller +import poller +import connection from ansible import callbacks as ans_callbacks HAS_ATFORK=True diff --git a/lib/ansible/runner/connection/__init__.py b/lib/ansible/runner/connection/__init__.py index da242a22fb..fb88c322e1 100644 --- a/lib/ansible/runner/connection/__init__.py +++ b/lib/ansible/runner/connection/__init__.py @@ -29,8 +29,8 @@ import pipes import socket import random -from ansible.runner.connection import local -from ansible.runner.connection import paramiko_ssh +import local +import paramiko_ssh class Connection(object): ''' Handles abstract connections to remote hosts ''' diff --git a/lib/ansible/runner/connection/paramiko_ssh.py b/lib/ansible/runner/connection/paramiko_ssh.py index af3ea88a73..fb58b42ae4 100644 --- a/lib/ansible/runner/connection/paramiko_ssh.py +++ b/lib/ansible/runner/connection/paramiko_ssh.py @@ -99,8 +99,8 @@ class ParamikoConnection(object): # 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 = 'sudo -k -p "%s" -u %s -- "$SHELL" -c %s' % (prompt, - sudo_user, pipes.quote(cmd)) + sudocmd = 'sudo -k && sudo -p "%s" -u %s -- "$SHELL" -c %s' % ( + prompt, sudo_user, pipes.quote(cmd)) sudo_output = '' try: chan.exec_command(sudocmd)