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
fe091ec0
Commit
fe091ec0
authored
Jan 28, 2014
by
James Tanner
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'slow_ssh' of
git://github.com/lberruti/ansible
into lberruti-slow_ssh
parents
aed2194b
ae543eec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
28 deletions
+8
-28
lib/ansible/runner/connection_plugins/ssh.py
+4
-14
lib/ansible/runner/connection_plugins/ssh_old.py
+4
-14
No files found.
lib/ansible/runner/connection_plugins/ssh.py
View file @
fe091ec0
...
...
@@ -268,6 +268,7 @@ class Connection(object):
raise
errors
.
AnsibleError
(
'SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh'
)
while
True
:
rfd
,
wfd
,
efd
=
select
.
select
(
rpipes
,
[],
rpipes
,
1
)
process_over
=
p
.
poll
()
is
not
None
# fail early if the sudo/su password is wrong
if
self
.
runner
.
sudo
and
sudoable
and
self
.
runner
.
sudo_pass
:
...
...
@@ -283,22 +284,11 @@ class Connection(object):
raise
errors
.
AnsibleError
(
'Incorrect su password'
)
if
p
.
stdout
in
rfd
:
dat
=
os
.
read
(
p
.
stdout
.
fileno
(),
9000
)
stdout
+=
dat
if
dat
==
''
:
rpipes
.
remove
(
p
.
stdout
)
stdout
+=
os
.
read
(
p
.
stdout
.
fileno
(),
9000
)
if
p
.
stderr
in
rfd
:
dat
=
os
.
read
(
p
.
stderr
.
fileno
(),
9000
)
stderr
+=
dat
if
dat
==
''
:
rpipes
.
remove
(
p
.
stderr
)
# only break out if we've emptied the pipes, or there is nothing to
# read from and the process has finished.
if
(
not
rpipes
or
not
rfd
)
and
p
.
poll
()
is
not
None
:
stderr
+=
os
.
read
(
p
.
stderr
.
fileno
(),
9000
)
if
process_over
:
break
# Calling wait while there are still pipes to read can cause a lock
elif
not
rpipes
and
p
.
poll
()
==
None
:
p
.
wait
()
stdin
.
close
()
# close stdin after we read from stdout (see also issue #848)
if
C
.
HOST_KEY_CHECKING
and
not_in_host_file
:
...
...
lib/ansible/runner/connection_plugins/ssh_old.py
View file @
fe091ec0
...
...
@@ -230,6 +230,7 @@ class Connection(object):
rpipes
=
[
p
.
stdout
,
p
.
stderr
]
while
True
:
rfd
,
wfd
,
efd
=
select
.
select
(
rpipes
,
[],
rpipes
,
1
)
process_over
=
p
.
poll
()
is
not
None
# fail early if the sudo/su password is wrong
if
self
.
runner
.
sudo
and
sudoable
and
self
.
runner
.
sudo_pass
:
...
...
@@ -245,22 +246,11 @@ class Connection(object):
raise
errors
.
AnsibleError
(
'Incorrect su password'
)
if
p
.
stdout
in
rfd
:
dat
=
os
.
read
(
p
.
stdout
.
fileno
(),
9000
)
stdout
+=
dat
if
dat
==
''
:
rpipes
.
remove
(
p
.
stdout
)
stdout
+=
os
.
read
(
p
.
stdout
.
fileno
(),
9000
)
if
p
.
stderr
in
rfd
:
dat
=
os
.
read
(
p
.
stderr
.
fileno
(),
9000
)
stderr
+=
dat
if
dat
==
''
:
rpipes
.
remove
(
p
.
stderr
)
# only break out if we've emptied the pipes, or there is nothing to
# read from and the process has finished.
if
(
not
rpipes
or
not
rfd
)
and
p
.
poll
()
is
not
None
:
stderr
+=
os
.
read
(
p
.
stderr
.
fileno
(),
9000
)
if
process_over
:
break
# Calling wait while there are still pipes to read can cause a lock
elif
not
rpipes
and
p
.
poll
()
==
None
:
p
.
wait
()
stdin
.
close
()
# close stdin after we read from stdout (see also issue #848)
if
C
.
HOST_KEY_CHECKING
and
not_in_host_file
:
...
...
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