Don't delete failed docker-puppet containers
authorSteve Baker <sbaker@redhat.com>
Tue, 16 May 2017 04:39:05 +0000 (04:39 +0000)
committerSteve Baker <sbaker@redhat.com>
Wed, 17 May 2017 03:46:25 +0000 (03:46 +0000)
This helps a bit with debugging issues, and the container will be
deleted on the next run when the same volume is configured.

Change-Id: I4f2f219bd7e40abafd0eb31c1275fdd8ed4db4da

docker/docker-puppet.py

index f1594d2..49dd00c 100755 (executable)
@@ -253,7 +253,9 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
             log.debug(cmd_stderr)
         if subproc.returncode != 0:
             log.error('Failed running docker-puppet.py for %s' % config_volume)
-        rm_container('docker-puppet-%s' % config_volume)
+        else:
+            # only delete successful runs, for debugging
+            rm_container('docker-puppet-%s' % config_volume)
         return subproc.returncode
 
 # Holds all the information for each process to consume.