mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-20 02:52:11 +00:00
fixed MIAB python error
This commit is contained in:
parent
24953ab912
commit
5d489d9cb5
@ -16,7 +16,7 @@ def write_settings(config, env):
|
||||
f.write(rtyaml.dump(config))
|
||||
|
||||
def load_settings(env):
|
||||
fn = os.path.join(env['STORAGE_ROOT'], 'settings.yaml')
|
||||
fn = os.path( sys.argv[2] )
|
||||
try:
|
||||
config = rtyaml.load(open(fn, "r"))
|
||||
if not isinstance(config, dict): raise ValueError() # caught below
|
||||
@ -29,7 +29,7 @@ env = load_environment()
|
||||
if(sys.argv[2]):
|
||||
|
||||
if( sys.argv[1] == "check" ):
|
||||
yaml = rtyaml.load(open( os.path.join(env['STORAGE_ROOT'], 'settings.yaml') ))
|
||||
yaml = rtyaml.load(open( sys.argv[2] ))
|
||||
|
||||
if( yaml.get("mailinabox-agreement", True) ):
|
||||
print("true")
|
||||
|
@ -274,7 +274,7 @@ function set_config_agreed {
|
||||
fi
|
||||
|
||||
local current_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
local yaml_agreed=$(python set "${current_directory}"/checkagree.py "${STORAGE_ROOT}/settings.yaml")
|
||||
local yaml_agreed=$(python set "${current_directory}"/checkagree.py "${STORAGE_ROOT}settings.yaml")
|
||||
if [ "$yaml_agreed" == "true"]; then
|
||||
return 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user