From e6effb32b8ab721c5c9986ba63ea2a1eb9c55c71 Mon Sep 17 00:00:00 2001 From: John R Barker Date: Thu, 8 Mar 2018 10:54:29 +0000 Subject: [PATCH] Update developing_api.rst (#37108) (#37178) Fix for #17716 and #36110 (cherry picked from commit 19f92005b9b7070fe1d661332236399876abdc18) --- docs/docsite/rst/dev_guide/developing_api.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/docsite/rst/dev_guide/developing_api.rst b/docs/docsite/rst/dev_guide/developing_api.rst index 0ad3f2fdf83..e486f595799 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: