mirror of
https://github.com/ha7ilm/openwebrx.git
synced 2026-03-17 02:14:42 +01:00
improve config version check
This commit is contained in:
parent
b8808ac8b0
commit
542f5db58e
|
|
@ -140,7 +140,11 @@ class Migrator(object):
|
|||
def migrate(config):
|
||||
version = config["version"] if "version" in config else 1
|
||||
if version == Migrator.currentVersion:
|
||||
return config
|
||||
return
|
||||
elif version > Migrator.currentVersion:
|
||||
raise ValueError(
|
||||
"Configuration version is too high (current: {}, found: {})".format(Migrator.currentVersion, version)
|
||||
)
|
||||
|
||||
logger.debug("migrating config from version %i", version)
|
||||
migrators = [Migrator.migrators[i] for i in range(version, Migrator.currentVersion)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue