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
3879550e
Commit
3879550e
authored
Apr 27, 2015
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finish backporting of smart transport selection from v1 into v2
parent
6eba0d17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
v2/ansible/executor/task_executor.py
+17
-6
No files found.
v2/ansible/executor/task_executor.py
View file @
3879550e
...
...
@@ -19,6 +19,12 @@
from
__future__
import
(
absolute_import
,
division
,
print_function
)
__metaclass__
=
type
import
json
import
pipes
import
subprocess
import
sys
import
time
from
ansible
import
constants
as
C
from
ansible.errors
import
AnsibleError
,
AnsibleParserError
from
ansible.executor.connection_info
import
ConnectionInformation
...
...
@@ -32,10 +38,6 @@ from ansible.utils.debug import debug
__all__
=
[
'TaskExecutor'
]
import
json
import
time
import
pipes
class
TaskExecutor
:
'''
...
...
@@ -365,11 +367,20 @@ class TaskExecutor:
if
self
.
_task
.
delegate_to
is
not
None
:
self
.
_compute_delegate
(
variables
)
# FIXME: add all port/connection type munging here (accelerated mode,
# fixing up options for ssh, etc.)? and 'smart' conversion
conn_type
=
self
.
_connection_info
.
connection
if
conn_type
==
'smart'
:
conn_type
=
'ssh'
if
sys
.
platform
.
startswith
(
'darwin'
)
and
self
.
_connection_info
.
remote_pass
:
# due to a current bug in sshpass on OSX, which can trigger
# a kernel panic even for non-privileged users, we revert to
# paramiko on that OS when a SSH password is specified
conn_type
=
"paramiko"
else
:
# see if SSH can support ControlPersist if not use paramiko
cmd
=
subprocess
.
Popen
([
'ssh'
,
'-o'
,
'ControlPersist'
],
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
(
out
,
err
)
=
cmd
.
communicate
()
if
"Bad configuration option"
in
err
:
conn_type
=
"paramiko"
connection
=
connection_loader
.
get
(
conn_type
,
self
.
_connection_info
,
self
.
_new_stdin
)
if
not
connection
:
...
...
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