Commit f2e4363c authored by Michele Tartara's avatar Michele Tartara
Browse files

Make cfgupgrade idempotent

One of the unit tests checks whether cfgupgrade's downgrade option is
idempotent. It is, but a version number check made it impossible to
actually downgrade multiple times.

With this change, both the current-version version number and the
target-version version number are accepted by the downgrade tool.
Signed-off-by: default avatarMichele Tartara <>
Reviewed-by: default avatarGuido Trotter <>
parent 77018a43
......@@ -437,7 +437,9 @@ def main():
# Downgrade to the previous stable version
if options.downgrade:
if config_major != TARGET_MAJOR or config_minor != TARGET_MINOR:
if not ((config_major == TARGET_MAJOR and config_minor == TARGET_MINOR) or
(config_major == DOWNGRADE_MAJOR and
config_minor == DOWNGRADE_MINOR)):
raise Error("Downgrade supported only from the latest version (%s.%s),"
" found %s (%s.%s.%s) instead" %
(TARGET_MAJOR, TARGET_MINOR, config_version, config_major,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment