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
c3ccf26b
Commit
c3ccf26b
authored
Jun 14, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added become check back to connections
parent
de82c953
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lib/ansible/plugins/connections/__init__.py
+6
-3
No files found.
lib/ansible/plugins/connections/__init__.py
View file @
c3ccf26b
...
@@ -63,10 +63,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
...
@@ -63,10 +63,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
if
not
hasattr
(
self
,
'_connected'
):
if
not
hasattr
(
self
,
'_connected'
):
self
.
_connected
=
False
self
.
_connected
=
False
def
_become_method_supported
(
self
,
become_method
):
def
_become_method_supported
(
self
):
''' Checks if the current class supports this privilege escalation method '''
''' Checks if the current class supports this privilege escalation method '''
if
become_method
in
self
.
__class__
.
become_methods
:
if
self
.
_connection_info
.
become_method
in
self
.
__class__
.
become_methods
:
return
True
return
True
raise
AnsibleError
(
"Internal Error: this connection module does not support running commands via
%
s"
%
become_method
)
raise
AnsibleError
(
"Internal Error: this connection module does not support running commands via
%
s"
%
become_method
)
...
@@ -90,7 +90,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
...
@@ -90,7 +90,10 @@ class ConnectionBase(with_metaclass(ABCMeta, object)):
@abstractmethod
@abstractmethod
def
_connect
(
self
):
def
_connect
(
self
):
"""Connect to the host we've been initialized with"""
"""Connect to the host we've been initialized with"""
pass
# Check if PE is supported
if
self
.
_connection_info
.
become
:
self
.
__become_method_supported
()
@ensure_connect
@ensure_connect
@abstractmethod
@abstractmethod
...
...
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