Ansible launcher: use sequence-uuid in shell scripts
For the generated shell scripts which are named using UUID4, prepend a
sequence count to them to easily be able to tell the ordering of the
scripts when looking in '_zuul_ansible/scripts/'. Keep the uuid to
avoid potential collisions in /tmp.
Change-Id: Id80bf5139ba1ce12c62945421d49c5e3cd8e2f48
diff --git a/zuul/launcher/ansiblelaunchserver.py b/zuul/launcher/ansiblelaunchserver.py
index be4348a..11bcf79 100644
--- a/zuul/launcher/ansiblelaunchserver.py
+++ b/zuul/launcher/ansiblelaunchserver.py
@@ -24,6 +24,7 @@
import threading
import time
import traceback
+import uuid
import Queue
import gear
@@ -1269,7 +1270,7 @@
def _makeBuilderTask(self, jobdir, builder, parameters, sequence):
tasks = []
- script_fn = '%02d.sh' % sequence
+ script_fn = '%02d-%s.sh' % (sequence, str(uuid.uuid4().hex))
script_path = os.path.join(jobdir.script_root, script_fn)
with open(script_path, 'w') as script:
data = builder['shell']