From 90636a9d46b8a78b9bae14dbcc4347bf658c0b51 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Thu, 19 Nov 2020 12:41:45 +0100 Subject: [PATCH] Dump generated configs from templates to stdout (cherry picked from commit f51f65ebaf0755d5b780031ba55b00c0df3f0963) --- dockerdata/startup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dockerdata/startup.py b/dockerdata/startup.py index 4e09b29329..7819cc306e 100755 --- a/dockerdata/startup.py +++ b/dockerdata/startup.py @@ -50,6 +50,7 @@ if apikey is not None: conffile = os.path.join(templatedestination, '_api.conf') with open(conffile, 'w') as f: f.write(webserver_conf) + print("Created {} with content:\n{}\n".format(conffile, webserver_conf)) templates = os.getenv('TEMPLATE_FILES') if templates is not None: @@ -58,7 +59,9 @@ if templates is not None: with open(os.path.join(templateroot, templateFile + '.j2')) as f: template = jinja2.Template(f.read()) rendered = template.render(os.environ) - with open(os.path.join(templatedestination, templateFile + '.conf'), 'w') as f: + target = os.path.join(templatedestination, templateFile + '.conf') + with open(target, 'w') as f: f.write(rendered) + print("Created {} with content:\n{}\n".format(target, rendered)) os.execv(program, [program]+args+sys.argv[1:]) -- 2.47.3