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:
parent
9b3fce3cbf
commit
2abaa7415d
@ -11,12 +11,12 @@ def load_environment():
|
|||||||
return env
|
return env
|
||||||
|
|
||||||
def write_settings(config, 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:
|
with open(fn, "w") as f:
|
||||||
f.write(rtyaml.dump(config))
|
f.write(rtyaml.dump(config))
|
||||||
|
|
||||||
def load_settings(env):
|
def load_settings(env):
|
||||||
fn = os.path( sys.argv[2] )
|
fn = sys.argv[2]
|
||||||
try:
|
try:
|
||||||
config = rtyaml.load(open(fn, "r"))
|
config = rtyaml.load(open(fn, "r"))
|
||||||
if not isinstance(config, dict): raise ValueError() # caught below
|
if not isinstance(config, dict): raise ValueError() # caught below
|
||||||
@ -41,5 +41,4 @@ if(sys.argv[2]):
|
|||||||
config = load_settings(env)
|
config = load_settings(env)
|
||||||
|
|
||||||
config["mailinabox-agreement"] = True
|
config["mailinabox-agreement"] = True
|
||||||
write_settings( config, env )
|
write_settings( config, env )
|
||||||
print("true")
|
|
@ -274,9 +274,5 @@ function set_config_agreed {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
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 $?)
|
python "${current_directory}"/agreement.py set "${STORAGE_ROOT}"/settings.yaml
|
||||||
if [ "$yaml_agreed" == "true" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
return 1
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user