Skip to content

Commit

Permalink
Merge pull request #33 from GoDjango-Development/godjangollc-patch-1
Browse files Browse the repository at this point in the history
Update startup.py
  • Loading branch information
lmdelbahia authored Dec 10, 2023
2 parents d53fe0f + 18c0e3c commit f6564ea
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions container/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def generate_keypair():
if os.path.exists("/run/secrets/"):
files = os.listdir("/run/secrets")
for file in files:
with open(file, "r") as opened_file:
with open(f"/run/secrets/{file}", "r") as opened_file:
first_line = opened_file.readline()
if first_line.startswith("#") and "key_pair" in first_line:
data = opened_file.readall().split("\n\n")
data = opened_file.read().split("\n\n")
data = list(filter(lambda elem: len(elem.strip()) > 0, data))
key_pair = {
"public_key": None,
Expand Down Expand Up @@ -92,6 +92,7 @@ def generate():
pubkey_file.close()

if __name__ == "__main__":
generate_keypair()
generate()
if os.getenv("DEBUG") == "true":
os.system("/usr/local/bin/tfd_debug %s"%conf_path)
Expand Down

0 comments on commit f6564ea

Please sign in to comment.