X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=docker%2Fdocker-puppet.py;h=86c8ec98accfb5a86e4e6440f0fecbcd0140c3f1;hb=db02313b2869aac0d0ddd41129eb9bebed1a24ad;hp=a642e84814004f321c0dee3c16465b2ca5c6dbc8;hpb=547eb9e860a61268b4ab0a16bac167b4ace87f89;p=apex-tripleo-heat-templates.git diff --git a/docker/docker-puppet.py b/docker/docker-puppet.py index a642e848..86c8ec98 100755 --- a/docker/docker-puppet.py +++ b/docker/docker-puppet.py @@ -46,6 +46,15 @@ def pull_image(name): def rm_container(name): + if os.environ.get('SHOW_DIFF', None): + print('Diffing container: %s' % name) + subproc = subprocess.Popen(['/usr/bin/docker', 'diff', name], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + cmd_stdout, cmd_stderr = subproc.communicate() + print(cmd_stdout) + print(cmd_stderr) + print('Removing container: %s' % name) subproc = subprocess.Popen(['/usr/bin/docker', 'rm', name], stdout=subprocess.PIPE, @@ -127,7 +136,7 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume mkdir -p /etc/puppet cp -a /tmp/puppet-etc/* /etc/puppet rm -Rf /etc/puppet/ssl # not in use and causes permission errors - echo '{"step": 6}' > /etc/puppet/hieradata/docker.json + echo '{"step": %(step)s}' > /etc/puppet/hieradata/docker.json TAGS="" if [ -n "%(puppet_tags)s" ]; then TAGS='--tags "%(puppet_tags)s"' @@ -162,7 +171,8 @@ def mp_puppet_config((config_volume, puppet_tags, manifest, config_image, volume fi """ % {'puppet_tags': puppet_tags, 'name': config_volume, 'hostname': hostname, - 'no_archive': os.environ.get('NO_ARCHIVE', '')}) + 'no_archive': os.environ.get('NO_ARCHIVE', ''), + 'step': os.environ.get('STEP', '6')}) with tempfile.NamedTemporaryFile() as tmp_man: with open(tmp_man.name, 'w') as man_file: