Skip to content
Snippets Groups Projects
Commit a1732bbf authored by Richard van der Hoff's avatar Richard van der Hoff
Browse files

improve logging for generate_config_from_template

parent 043ab6da
No related branches found
No related tags found
No related merge requests found
......@@ -67,10 +67,11 @@ def generate_config_from_template(environ, ownership):
# generate a new secret and write it to a file
if os.path.exists(filename):
log("Reading %s from %s" % (secret, filename))
with open(filename) as handle:
value = handle.read()
else:
log("Generating a random secret for {}".format(name))
log("Generating a random secret for {}".format(secret))
value = codecs.encode(os.urandom(32), "hex").decode()
with open(filename, "w") as handle:
handle.write(value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment