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
904f3312
Commit
904f3312
authored
Apr 02, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6788 from tyll/pull_ssh_verbose_comments
ssh connection plugin: Make comments more verbose
parents
12022233
e6cb32f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
lib/ansible/runner/connection_plugins/ssh.py
+12
-6
No files found.
lib/ansible/runner/connection_plugins/ssh.py
View file @
904f3312
...
...
@@ -151,6 +151,7 @@ class Connection(object):
stdin
.
close
()
except
:
raise
errors
.
AnsibleError
(
'SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh'
)
# Read stdout/stderr from process
while
True
:
rfd
,
wfd
,
efd
=
select
.
select
(
rpipes
,
[],
rpipes
,
1
)
...
...
@@ -177,17 +178,22 @@ class Connection(object):
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.
# only break out if no pipes are left to read or
# the pipes are completely read and
# the process is terminated
if
(
not
rpipes
or
not
rfd
)
and
p
.
poll
()
is
not
None
:
break
# Calling wait while there are still pipes to read can cause a lock
# No pipes are left to read but process is not yet terminated
# Only then it is safe to wait for the process to be finished
# NOTE: Actually p.poll() is always None here if rpipes is empty
elif
not
rpipes
and
p
.
poll
()
==
None
:
p
.
wait
()
#
the process has finished and the pipes are empty,
#
if we loop and do the select it waits all the timeout
#
The process is terminated. Since no pipes to read from are
#
left, there is no need to call select() again.
break
stdin
.
close
()
# close stdin after we read from stdout (see also issue #848)
# close stdin after process is terminated and stdout/stderr are read
# completely (see also issue #848)
stdin
.
close
()
return
(
p
.
returncode
,
stdout
,
stderr
)
def
not_in_host_file
(
self
,
host
):
...
...
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