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
b89071e4
Commit
b89071e4
authored
Jun 15, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now detects incorrect password with sudo and su (at least in english)
parent
5bac17de
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletions
+2
-1
lib/ansible/constants.py
+1
-0
lib/ansible/plugins/connections/__init__.py
+1
-1
No files found.
lib/ansible/constants.py
View file @
b89071e4
...
@@ -151,6 +151,7 @@ DEFAULT_SUDO_FLAGS = get_config(p, DEFAULTS, 'sudo_flags', 'ANSIBLE_SUDO_
...
@@ -151,6 +151,7 @@ DEFAULT_SUDO_FLAGS = get_config(p, DEFAULTS, 'sudo_flags', 'ANSIBLE_SUDO_
DEFAULT_ASK_SUDO_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_sudo_pass'
,
'ANSIBLE_ASK_SUDO_PASS'
,
False
,
boolean
=
True
)
DEFAULT_ASK_SUDO_PASS
=
get_config
(
p
,
DEFAULTS
,
'ask_sudo_pass'
,
'ANSIBLE_ASK_SUDO_PASS'
,
False
,
boolean
=
True
)
# Become
# Become
BECOME_ERROR_STRINGS
=
{
'sudo'
:
'Sorry, try again.'
,
'su'
:
'Authentication failure'
,
'pbrun'
:
''
,
'pfexec'
:
''
,
'runas'
:
''
}
#FIXME: deal with i18n
BECOME_METHODS
=
[
'sudo'
,
'su'
,
'pbrun'
,
'pfexec'
,
'runas'
]
BECOME_METHODS
=
[
'sudo'
,
'su'
,
'pbrun'
,
'pfexec'
,
'runas'
]
DEFAULT_BECOME_METHOD
=
get_config
(
p
,
'privilege_escalation'
,
'become_method'
,
'ANSIBLE_BECOME_METHOD'
,
'sudo'
if
DEFAULT_SUDO
else
'su'
if
DEFAULT_SU
else
'sudo'
)
.
lower
()
DEFAULT_BECOME_METHOD
=
get_config
(
p
,
'privilege_escalation'
,
'become_method'
,
'ANSIBLE_BECOME_METHOD'
,
'sudo'
if
DEFAULT_SUDO
else
'su'
if
DEFAULT_SU
else
'sudo'
)
.
lower
()
DEFAULT_BECOME
=
get_config
(
p
,
'privilege_escalation'
,
'become'
,
'ANSIBLE_BECOME'
,
False
,
boolean
=
True
)
DEFAULT_BECOME
=
get_config
(
p
,
'privilege_escalation'
,
'become'
,
'ANSIBLE_BECOME'
,
False
,
boolean
=
True
)
...
...
lib/ansible/plugins/connections/__init__.py
View file @
b89071e4
...
@@ -129,6 +129,6 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
...
@@ -129,6 +129,6 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
return
prompt
(
output
)
return
prompt
(
output
)
def
check_incorrect_password
(
self
,
output
,
prompt
):
def
check_incorrect_password
(
self
,
output
,
prompt
):
incorrect_password
=
gettext
.
dgettext
(
self
.
_connection_info
.
become_method
,
"Sorry, try again."
)
incorrect_password
=
gettext
.
dgettext
(
self
.
_connection_info
.
become_method
,
C
.
BECOME_ERROR_STRINGS
[
self
.
_connection_info
.
become_method
]
)
return
output
.
endswith
(
incorrect_password
)
return
output
.
endswith
(
incorrect_password
)
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