From 2abaa7415df39e221b6d12e8de54050369b7d439 Mon Sep 17 00:00:00 2001 From: EliterScripts Date: Tue, 9 Apr 2019 23:36:49 -0700 Subject: [PATCH] fixed how settings.yaml is written --- setup/agreement.py | 7 +++---- setup/functions.sh | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/setup/agreement.py b/setup/agreement.py index e9f39e20..aaa7289e 100644 --- a/setup/agreement.py +++ b/setup/agreement.py @@ -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 @@ -41,5 +41,4 @@ if(sys.argv[2]): config = load_settings(env) config["mailinabox-agreement"] = True - write_settings( config, env ) - print("true") \ No newline at end of file + write_settings( config, env ) \ No newline at end of file diff --git a/setup/functions.sh b/setup/functions.sh index b192260e..e42b0b13 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -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 } \ No newline at end of file