From 123d54e736520c59d8c7afdcb1c6526df501b174 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Fri, 29 Jul 2016 23:03:34 -0400 Subject: [PATCH] added pid to backup file name to avoid collisions --- lib/ansible/module_utils/basic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/basic.py b/lib/ansible/module_utils/basic.py index df4f176b53..3f27ae8f4d 100644 --- a/lib/ansible/module_utils/basic.py +++ b/lib/ansible/module_utils/basic.py @@ -1820,7 +1820,7 @@ class AnsibleModule(object): if os.path.exists(fn): # backups named basename-YYYY-MM-DD@HH:MM:SS~ ext = time.strftime("%Y-%m-%d@%H:%M:%S~", time.localtime(time.time())) - backupdest = '%s.%s' % (fn, ext) + backupdest = '%s.%s.%s' % (fn, os.getpid(), ext) try: shutil.copy2(fn, backupdest)