This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
pespin gerrit-no-reply at lists.osmocom.orgpespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18826 )
Change subject: config: Allow empty config files
......................................................................
config: Allow empty config files
Change-Id: Ic010e06220421df00405c5b6f5ad2e83514b6dcd
---
M src/osmo_gsm_tester/core/config.py
M src/osmo_gsm_tester/core/resource.py
2 files changed, 4 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/osmo_gsm_tester/core/config.py b/src/osmo_gsm_tester/core/config.py
index 398e8ba..a8860d3 100644
--- a/src/osmo_gsm_tester/core/config.py
+++ b/src/osmo_gsm_tester/core/config.py
@@ -137,6 +137,8 @@
global MAIN_CONFIG
if MAIN_CONFIG is None:
cfg = read(_get_main_config_path(), MAIN_CONFIG_SCHEMA)
+ if cfg is None:
+ cfg = {}
MAIN_CONFIG = {
CFG_STATE_DIR: DF_CFG_STATE_DIR,
CFG_SUITES_DIR: DF_CFG_SUITES_DIR,
@@ -195,7 +197,7 @@
with open(path, 'r') as f:
config = yaml.safe_load(f)
config = _standardize(config)
- if validation_schema:
+ if config and validation_schema:
schema.validate(config, validation_schema)
return config
diff --git a/src/osmo_gsm_tester/core/resource.py b/src/osmo_gsm_tester/core/resource.py
index af05a51..62bba07 100644
--- a/src/osmo_gsm_tester/core/resource.py
+++ b/src/osmo_gsm_tester/core/resource.py
@@ -54,7 +54,7 @@
self.read_conf()
def read_conf(self):
- self.all_resources = Resources(config.read(self.config_path, schema.get_resources_schema()))
+ self.all_resources = Resources(config.read(self.config_path, schema.get_resources_schema()) or {})
self.all_resources.set_hashes()
def reserve(self, origin, want, modifiers):
--
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/18826
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: Ic010e06220421df00405c5b6f5ad2e83514b6dcd
Gerrit-Change-Number: 18826
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200615/1f9c7d58/attachment.htm>