From 816411aa7bdb0797285d23d284d10b5c931e89cc Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 26 May 2021 11:00:43 +0200 Subject: [PATCH] fixing settings.ini wbconf --- ereuse_devicehub/config.py | 2 ++ .../resources/documents/documents.py | 4 ++-- .../templates/documents/wbSettings.ini | 20 ++++++++++--------- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 5a37ace0..58176223 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -44,6 +44,8 @@ class DevicehubConfig(Config): host=DB_HOST, db=DB_DATABASE, ) # type: str + SCHEMA = config('SCHEMA', 'dbtest') + HOST = config('HOST', 'localhost') MIN_WORKBENCH = StrictVersion('11.0a1') # type: StrictVersion """The minimum version of ereuse.org workbench that this devicehub accepts. we recommend not changing this value. diff --git a/ereuse_devicehub/resources/documents/documents.py b/ereuse_devicehub/resources/documents/documents.py index 3b72d85d..d32749f5 100644 --- a/ereuse_devicehub/resources/documents/documents.py +++ b/ereuse_devicehub/resources/documents/documents.py @@ -323,8 +323,8 @@ class WbConfDocumentView(DeviceView): return jsonify('') data = {'token': self.get_token(), - 'host': app.config['DB_HOST'], - 'inventory': app.config['DB_SCHEMA'] + 'host': app.config['HOST'], + 'inventory': app.config['SCHEMA'] } data['erase'] = False # data['erase'] = True if wbtype == 'usodywipe' else False diff --git a/ereuse_devicehub/resources/documents/templates/documents/wbSettings.ini b/ereuse_devicehub/resources/documents/templates/documents/wbSettings.ini index c7156a65..8d1933bc 100644 --- a/ereuse_devicehub/resources/documents/templates/documents/wbSettings.ini +++ b/ereuse_devicehub/resources/documents/templates/documents/wbSettings.ini @@ -1,17 +1,19 @@ [settings] -DH_TOKEN="{{token}}" +DH_TOKEN = {{token}} -DH_HOST="{{host}}" -DH_DATABASE="{{inventory}}" -DEVICEHUB_URL=https://${DB_HOST}/${DB_DATABASE}/ +DH_HOST = {{host}} +DH_DATABASE = {{inventory}} +DEVICEHUB_URL = https://${DB_HOST}/${DB_DATABASE}/ -WB_BENCHMARK = False -WB_STRESS_TEST = 0 -WB_SMART_TEST = "" -WB_ERASE = {{erase}} +WB_BENCHMARK = True +WB_STRESS_TEST = 1 +WB_SMART_TEST = short + +WB_ERASE = WB_ERASE_STEPS = 1 WB_ERASE_LEADING_ZEROS = False -WB_DEBUG = True +WB_DEBUG = False +