mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2025-04-21 03:02:09 +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))
|
f.write(rtyaml.dump(config))
|
||||||
|
|
||||||
def load_settings(env):
|
def load_settings(env):
|
||||||
fn = os.path.join(env['STORAGE_ROOT'], 'settings.yaml')
|
fn = os.path( 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
|
||||||
@ -29,7 +29,7 @@ env = load_environment()
|
|||||||
if(sys.argv[2]):
|
if(sys.argv[2]):
|
||||||
|
|
||||||
if( sys.argv[1] == "check" ):
|
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) ):
|
if( yaml.get("mailinabox-agreement", True) ):
|
||||||
print("true")
|
print("true")
|
||||||
|
@ -274,7 +274,7 @@ 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 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
|
if [ "$yaml_agreed" == "true"]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user