1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-20 02:52:11 +00:00

fixed how settings.yaml is written

This commit is contained in:
EliterScripts 2019-04-09 23:36:49 -07:00
parent 9b3fce3cbf
commit 2abaa7415d
2 changed files with 4 additions and 9 deletions

View File

@ -11,12 +11,12 @@ def load_environment():
return env
def write_settings(config, env):
fn = os.path.join(env['STORAGE_ROOT'], 'settings.yaml')
fn = sys.argv[2]
with open(fn, "w") as f:
f.write(rtyaml.dump(config))
def load_settings(env):
fn = os.path( sys.argv[2] )
fn = sys.argv[2]
try:
config = rtyaml.load(open(fn, "r"))
if not isinstance(config, dict): raise ValueError() # caught below
@ -42,4 +42,3 @@ if(sys.argv[2]):
config["mailinabox-agreement"] = True
write_settings( config, env )
print("true")

View File

@ -274,9 +274,5 @@ function set_config_agreed {
fi
local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
local yaml_agreed=$(python "${current_directory}"/agreement.py set "${STORAGE_ROOT}settings.yaml"; echo $?)
if [ "$yaml_agreed" == "true" ]; then
return 0
fi
return 1
python "${current_directory}"/agreement.py set "${STORAGE_ROOT}"/settings.yaml
}