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
f14c1e3e
Commit
f14c1e3e
authored
Apr 30, 2012
by
Jeroen Hoekx
Committed by
Michael DeHaan
May 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Async: print one poll message per polling cycle.
Instead of one per host per polling cycle.
parent
029fe127
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
lib/ansible/callbacks.py
+12
-2
No files found.
lib/ansible/callbacks.py
View file @
f14c1e3e
...
...
@@ -115,6 +115,7 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
def
__init__
(
self
):
# set by /usr/bin/ansible later
self
.
options
=
None
self
.
_async_notified
=
{}
def
on_failed
(
self
,
host
,
res
):
invocation
=
res
.
get
(
'invocation'
,
''
)
...
...
@@ -141,7 +142,11 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
print
>>
sys
.
stderr
,
"no hosts matched
\n
"
def
on_async_poll
(
self
,
host
,
res
,
jid
,
clock
):
print
"<job
%
s> polling on
%
s,
%
s remaining"
%
(
jid
,
host
,
clock
)
if
jid
not
in
self
.
_async_notified
:
self
.
_async_notified
[
jid
]
=
clock
+
1
if
self
.
_async_notified
[
jid
]
>
clock
:
self
.
_async_notified
[
jid
]
=
clock
print
"<job
%
s> polling,
%
ss remaining"
%
(
jid
,
clock
)
def
on_async_ok
(
self
,
host
,
res
,
jid
):
print
"<job
%
s> finished on
%
s =>
%
s"
%
(
jid
,
host
,
utils
.
bigjson
(
res
))
...
...
@@ -161,6 +166,7 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
def
__init__
(
self
,
stats
):
self
.
stats
=
stats
self
.
_async_notified
=
{}
def
on_unreachable
(
self
,
host
,
msg
):
print
"fatal: [
%
s] =>
%
s"
%
(
host
,
msg
)
...
...
@@ -191,7 +197,11 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
print
"no hosts matched or remaining
\n
"
def
on_async_poll
(
self
,
host
,
res
,
jid
,
clock
):
print
"<job
%
s> polling on
%
s,
%
s remaining"
%
(
jid
,
host
,
clock
)
if
jid
not
in
self
.
_async_notified
:
self
.
_async_notified
[
jid
]
=
clock
+
1
if
self
.
_async_notified
[
jid
]
>
clock
:
self
.
_async_notified
[
jid
]
=
clock
print
"<job
%
s> polling,
%
ss remaining"
%
(
jid
,
clock
)
def
on_async_ok
(
self
,
host
,
res
,
jid
):
print
"<job
%
s> finished on
%
s"
%
(
jid
,
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