From 8df37b6ea1b78e4e56cb2500ee06cbcc41f76618 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Tue, 8 Nov 2016 16:34:16 -0800 Subject: [PATCH] Show the rendered docker file It can be quite useful (especially while debugging) to see exactly what the final rendered Dockerfile actually is; so when it is being rendered, log it at DEBUG level (so that users running with DEBUG) can see it. Change-Id: I28b6f49a7d2f01d155f7885b6ab275c03c4e14af --- kolla/image/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kolla/image/build.py b/kolla/image/build.py index 231824e85b..8d5d6ee482 100644 --- a/kolla/image/build.py +++ b/kolla/image/build.py @@ -695,8 +695,12 @@ class KollaWorker(object): with open(self.include_footer, 'r') as f: values['include_footer'] = f.read() content = template.render(values) - with open(os.path.join(path, 'Dockerfile'), 'w') as f: + content_path = os.path.join(path, 'Dockerfile') + with open(content_path, 'w') as f: + LOG.debug("Rendered %s into:", tpl_path) + LOG.debug(content) f.write(content) + LOG.debug("Wrote it to %s", content_path) def find_dockerfiles(self): """Recursive search for Dockerfiles in the working directory"""