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
89bc43ca
Commit
89bc43ca
authored
Aug 08, 2013
by
Michael Vogt
Committed by
Michael DeHaan
Aug 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support i18n on sudo failure
parent
0905683c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lib/ansible/runner/connection_plugins/ssh.py
+6
-3
No files found.
lib/ansible/runner/connection_plugins/ssh.py
View file @
89bc43ca
...
...
@@ -25,6 +25,7 @@ import select
import
fcntl
import
hmac
import
pwd
import
gettext
from
hashlib
import
sha1
import
ansible.constants
as
C
from
ansible.callbacks
import
vvv
...
...
@@ -191,9 +192,11 @@ class Connection(object):
rfd
,
wfd
,
efd
=
select
.
select
([
p
.
stdout
,
p
.
stderr
],
[],
[
p
.
stdout
,
p
.
stderr
],
1
)
# fail early if the sudo password is wrong
if
(
self
.
runner
.
sudo
and
sudoable
and
self
.
runner
.
sudo_pass
and
stdout
.
endswith
(
"Sorry, try again.
\r\n
%
s"
%
prompt
)):
raise
errors
.
AnsibleError
(
'Incorrect sudo password'
)
if
self
.
runner
.
sudo
and
sudoable
and
self
.
runner
.
sudo_pass
:
incorrect_password
=
gettext
.
dgettext
(
"sudo"
,
"Sorry, try again."
)
if
stdout
.
endswith
(
"
%
s
\r\n
%
s"
%
(
incorrect_password
,
prompt
)):
raise
errors
.
AnsibleError
(
'Incorrect sudo password'
)
if
p
.
stdout
in
rfd
:
dat
=
os
.
read
(
p
.
stdout
.
fileno
(),
9000
)
...
...
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