Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
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
configuration
Commits
65aa0ea5
Commit
65aa0ea5
authored
Jul 27, 2016
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support Ansible 2.0
parent
71c5f89a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
playbooks/callback_plugins/task_timing.py
+12
-1
No files found.
playbooks/callback_plugins/task_timing.py
View file @
65aa0ea5
...
...
@@ -6,6 +6,12 @@ from os.path import splitext, basename, exists, dirname
import
sys
import
time
try
:
from
ansible.plugins.callback
import
CallbackBase
except
ImportError
:
# Support Ansible 1.9.x
CallbackBase
=
object
import
datadog
logging
.
basicConfig
(
level
=
logging
.
INFO
,
stream
=
sys
.
stdout
)
...
...
@@ -203,7 +209,7 @@ class LoggingTimingLogger(TimingLogger):
)
class
CallbackModule
(
object
):
class
CallbackModule
(
CallbackBase
):
"""
Ansible plugin get the time of each task and total time
...
...
@@ -214,6 +220,7 @@ class CallbackModule(object):
self
.
current_task
=
None
self
.
playbook_name
=
None
self
.
playbook_timestamp
=
None
self
.
play
=
None
self
.
loggers
=
[
DatadogTimingLogger
(),
...
...
@@ -221,6 +228,10 @@ class CallbackModule(object):
JsonTimingLogger
(),
]
def
v2_playbook_on_play_start
(
self
,
play
):
self
.
play
=
play
super
(
CallbackModule
,
self
)
.
v2_playbook_on_play_start
(
play
)
def
playbook_on_play_start
(
self
,
pattern
):
"""
Record the start of a play.
...
...
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