mirror of
https://github.com/runcitadel/core.git
synced 2024-11-12 00:39:53 +00:00
Move dotenv loading to get_var
This commit is contained in:
parent
4741ea8edc
commit
03c4eaf058
|
@ -81,6 +81,10 @@ def getArguments():
|
|||
return arguments
|
||||
|
||||
def get_var(var_name):
|
||||
if os.path.isfile(dotCitadelPath):
|
||||
dotenv=parse_dotenv(os.path.join(nodeRoot, "..", ".env"))
|
||||
else:
|
||||
dotenv=parse_dotenv(os.path.join(nodeRoot, ".env"))
|
||||
if var_name in dotenv:
|
||||
return str(dotenv[var_name])
|
||||
else:
|
||||
|
@ -106,10 +110,6 @@ def handleAppV4(app):
|
|||
yaml.dump(resultYml["spec"], dockerComposeFile)
|
||||
torDaemons = ["torrc-apps", "torrc-apps-2", "torrc-apps-3"]
|
||||
torFileToAppend = torDaemons[random.randint(0, len(torDaemons) - 1)]
|
||||
if os.path.isfile(dotCitadelPath):
|
||||
dotenv=parse_dotenv(os.path.join(nodeRoot, "..", ".env"))
|
||||
else:
|
||||
dotenv=parse_dotenv(os.path.join(nodeRoot, ".env"))
|
||||
with open(os.path.join(nodeRoot, "tor", torFileToAppend), 'a') as f:
|
||||
f.write(replace_vars(resultYml["new_tor_entries"]))
|
||||
mainPort = resultYml["port"]
|
||||
|
|
Loading…
Reference in New Issue
Block a user