summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn R Barker <john@johnrbarker.com>2018-03-08 10:54:29 +0000
committerGitHub <noreply@github.com>2018-03-08 10:54:29 +0000
commite6effb32b8ab721c5c9986ba63ea2a1eb9c55c71 (patch)
tree334f5a79edaac358eb5cfe3347b1dfd9fdc3e676
parent193687851bafd262a7311818276d3ad5df0ef383 (diff)
downloadansible-e6effb32b8ab721c5c9986ba63ea2a1eb9c55c71.tar.gz
Update developing_api.rst (#37108) (#37178)
Fix for #17716 and #36110 (cherry picked from commit 19f92005b9b7070fe1d661332236399876abdc18)
-rw-r--r--docs/docsite/rst/dev_guide/developing_api.rst5
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/docsite/rst/dev_guide/developing_api.rst b/docs/docsite/rst/dev_guide/developing_api.rst
index 0ad3f2fdf8..e486f59579 100644
--- a/docs/docsite/rst/dev_guide/developing_api.rst
+++ b/docs/docsite/rst/dev_guide/developing_api.rst
@@ -42,6 +42,7 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
#!/usr/bin/env python
import json
+ import shutil
from collections import namedtuple
from ansible.parsing.dataloader import DataLoader
from ansible.vars.manager import VariableManager
@@ -49,6 +50,7 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
from ansible.playbook.play import Play
from ansible.executor.task_queue_manager import TaskQueueManager
from ansible.plugins.callback import CallbackBase
+ import ansible.constants as C
class ResultCallback(CallbackBase):
"""A sample callback plugin used for performing an action as results come in
@@ -107,6 +109,9 @@ In 2.0 things get a bit more complicated to start, but you end up with much more
finally:
if tqm is not None:
tqm.cleanup()
+
+ # Remove ansible tmpdir
+ shutil.rmtree(C.DEFAULT_LOCAL_TMP, True)
.. _python_api_old: