From: Pieter Lexis Date: Thu, 19 Nov 2020 11:41:45 +0000 (+0100) Subject: Dump generated configs from templates to stdout X-Git-Tag: auth-4.4.0~2^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=90636a9d46b8a78b9bae14dbcc4347bf658c0b51;p=thirdparty%2Fpdns.git Dump generated configs from templates to stdout (cherry picked from commit f51f65ebaf0755d5b780031ba55b00c0df3f0963) --- 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:])