Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
671118ba
Commit
671118ba
authored
Jun 17, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed become password handling with paramiko
parent
744ec2bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
lib/ansible/plugins/connections/paramiko_ssh.py
+9
-5
No files found.
lib/ansible/plugins/connections/paramiko_ssh.py
View file @
671118ba
...
...
@@ -43,6 +43,7 @@ from ansible import constants as C
from
ansible.errors
import
AnsibleError
,
AnsibleConnectionFailure
,
AnsibleFileNotFound
from
ansible.plugins.connections
import
ConnectionBase
from
ansible.utils.path
import
makedirs_safe
from
ansible.utils.debug
import
debug
AUTHENTICITY_MSG
=
"""
paramiko: The authenticity of host '
%
s' can't be established.
...
...
@@ -216,17 +217,20 @@ class Connection(ConnectionBase):
self
.
_display
.
vvv
(
"EXEC
%
s"
%
cmd
,
host
=
self
.
_connection_info
.
remote_addr
)
if
sudoable
:
cmd
,
self
.
prompt
,
self
.
success_key
=
self
.
_connection_info
.
make_become_cmd
(
cmd
)
no_prompt_out
=
''
no_prompt_err
=
''
become_output
=
''
try
:
chan
.
exec_command
(
cmd
)
if
self
.
_connection_info
.
become_pass
:
if
self
.
prompt
:
while
True
:
if
success_key
in
become_output
or
\
(
prompt
and
become_output
.
endswith
(
prompt
))
or
\
utils
.
su_prompts
.
check_su_prompt
(
become_output
):
debug
(
'Waiting for Privilege Escalation input'
)
if
self
.
check_become_success
(
become_output
)
or
self
.
check_password_prompt
(
become_output
):
break
chunk
=
chan
.
recv
(
bufsize
)
if
not
chunk
:
...
...
@@ -237,7 +241,7 @@ class Connection(ConnectionBase):
raise
AnsibleError
(
'ssh connection '
+
'closed waiting for password prompt'
)
become_output
+=
chunk
if
success_key
not
in
become_output
:
if
not
self
.
check_become_success
(
become_output
)
:
if
self
.
_connection_info
.
become
:
chan
.
sendall
(
self
.
_connection_info
.
become_pass
+
'
\n
'
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment