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
2c98b271
Commit
2c98b271
authored
Jul 19, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make paramiko password detection logic match ssh connection
parent
3d77723e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
lib/ansible/plugins/connections/paramiko_ssh.py
+21
-19
No files found.
lib/ansible/plugins/connections/paramiko_ssh.py
View file @
2c98b271
...
@@ -224,25 +224,27 @@ class Connection(ConnectionBase):
...
@@ -224,25 +224,27 @@ class Connection(ConnectionBase):
try
:
try
:
chan
.
exec_command
(
cmd
)
chan
.
exec_command
(
cmd
)
if
self
.
_connection_info
.
prompt
:
if
self
.
_connection_info
.
prompt
:
while
True
:
if
self
.
_connection_info
.
become
and
self
.
_connection_info
.
become_pass
:
debug
(
'Waiting for Privilege Escalation input'
)
while
True
:
if
self
.
check_become_success
(
become_output
)
or
self
.
check_password_prompt
(
become_output
):
debug
(
'Waiting for Privilege Escalation input'
)
break
if
self
.
check_become_success
(
become_output
)
or
self
.
check_password_prompt
(
become_output
):
chunk
=
chan
.
recv
(
bufsize
)
break
if
not
chunk
:
chunk
=
chan
.
recv
(
bufsize
)
if
'unknown user'
in
become_output
:
print
(
"chunk is:
%
s"
%
chunk
)
raise
AnsibleError
(
if
not
chunk
:
'user
%
s does not exist'
%
become_user
)
if
'unknown user'
in
become_output
:
else
:
raise
AnsibleError
(
raise
AnsibleError
(
'ssh connection '
+
'user
%
s does not exist'
%
become_user
)
'closed waiting for password prompt'
)
else
:
become_output
+=
chunk
raise
AnsibleError
(
'ssh connection '
+
if
not
self
.
check_become_success
(
become_output
):
'closed waiting for password prompt'
)
if
self
.
_connection_info
.
become
:
become_output
+=
chunk
chan
.
sendall
(
self
.
_connection_info
.
become_pass
+
'
\n
'
)
if
not
self
.
check_become_success
(
become_output
):
else
:
if
self
.
_connection_info
.
become
:
no_prompt_out
+=
become_output
chan
.
sendall
(
self
.
_connection_info
.
become_pass
+
'
\n
'
)
no_prompt_err
+=
become_output
else
:
no_prompt_out
+=
become_output
no_prompt_err
+=
become_output
except
socket
.
timeout
:
except
socket
.
timeout
:
raise
AnsibleError
(
'ssh timed out waiting for privilege escalation.
\n
'
+
become_output
)
raise
AnsibleError
(
'ssh timed out waiting for privilege escalation.
\n
'
+
become_output
)
...
...
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