From 3f4027f7b46472a55b116778da79a508fd9d00cf Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 6 Jul 2016 10:02:20 -0700 Subject: [PATCH] Add the PID of the Ansible process to local_tmp directory. (#16589) This aids in associating a leftover cachedir with a previous run of Ansible. Came about because of #16489 --- lib/ansible/constants.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 7a9f63ee287..6e70d3c0d88 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -76,7 +76,8 @@ def get_config(p, section, key, env_var, default, boolean=False, integer=False, value = shell_expand(value) if not os.path.exists(value): os.makedirs(value, 0o700) - value = tempfile.mkdtemp(prefix='ansible-local-tmp', dir=value) + prefix = 'ansible-local-%s' % os.getpid() + value = tempfile.mkdtemp(prefix=prefix, dir=value) elif ispathlist: if isinstance(value, string_types): value = [shell_expand(x, expand_relative_paths=expand_relative_paths) \