docker-puppet: skip empty volume entries
authorJuan Antonio Osorio Robles <jaosorior@redhat.com>
Thu, 16 Mar 2017 11:20:41 +0000 (13:20 +0200)
committerJuan Antonio Osorio Robles <jaosorior@redhat.com>
Wed, 22 Mar 2017 08:11:21 +0000 (10:11 +0200)
This allows to optionally add volumes, where we could use a heat
conditional to either put the volume path we want or put an empty string
which should be safely skipped.

Change-Id: I68f91ffdd8ceb14735adad1322fcf124c47b160c

docker/docker-puppet.py

index 0f07943..8f95208 100755 (executable)
@@ -205,7 +205,8 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume
                 '--volume', '%s:%s:rw' % (sh_script, sh_script) ]
 
         for volume in volumes:
-            dcmd.extend(['--volume', volume])
+            if volume:
+                dcmd.extend(['--volume', volume])
 
         dcmd.extend(['--entrypoint', sh_script])