From 9748415c1be0c0e15b2fb3c37a0d17e0f4672005 Mon Sep 17 00:00:00 2001 From: Samuel Munilla Date: Mon, 29 Feb 2016 14:32:56 -0500 Subject: a-o-i: More flexible upgrade mappings Change the upgrade logic to allow for more than two types of upgrades. --- utils/src/ooinstall/cli_installer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils') diff --git a/utils/src/ooinstall/cli_installer.py b/utils/src/ooinstall/cli_installer.py index c53ca7b18..4f7af0465 100644 --- a/utils/src/ooinstall/cli_installer.py +++ b/utils/src/ooinstall/cli_installer.py @@ -762,6 +762,9 @@ def uninstall(ctx): oo_cfg = ctx.obj['oo_cfg'] verbose = ctx.obj['verbose'] + upgrade_mappings = {'3.0':'3.1', + '3.1':'3.2'} + if len(oo_cfg.hosts) == 0: click.echo("No hosts defined in: %s" % oo_cfg.config_path) sys.exit(1) @@ -802,8 +805,7 @@ def upgrade(ctx): resp = click.prompt("(1) Update to latest {} (2) Migrate to next relese".format(old_version)) if resp == "2": - # TODO: Make this a lot more flexible - new_version = "3.1" + new_version = upgrade_mappings.get(old_version) # Update config to reflect the version we're targetting, we'll write # to disk once ansible completes successfully, not before. if oo_cfg.settings['variant'] == 'enterprise': -- cgit v1.2.3