Skip to content

Commit

Permalink
install.upgrade: add pre-upgrade sanity check
Browse files Browse the repository at this point in the history
Add a pre-upgrade sanity check to the install.upgrade task. This sanity check:

1. determines the version of Ceph installed on the remote ("installed_version")
2. determines the version of Ceph in the target gitbuilder repo
("upgrade_version")
3. if "installed_version" is greater than "upgrade_version", fail immediately

Since the upgrade itself cannot succeed if upgrade_version < installed_version,
it's better to fail before attempting the upgrade.

Before this patch, we were failing in the verify_package_version() sanity check
which is run after attempting (and failing) to upgrade the packages.

Fixes: http://tracker.ceph.com/issues/16521
Signed-off-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Jun 29, 2016
1 parent 7b7b835 commit daff04b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions teuthology/task/install.py
Expand Up @@ -953,8 +953,15 @@ def upgrade_common(ctx, config, deploy_style):

for remote, node in remotes.iteritems():

installed_version = packaging.get_package_version(remote, 'ceph-common')
upgrade_version = _get_gitbuilder_project(ctx, remote, config).version
system_type = teuthology.get_system_type(remote)
assert system_type in ('deb', 'rpm')
log.info("Ceph {s} upgrade from {i} to {u}".format(
s=system_type,
i=installed_version,
u=upgrade_version
))
pkgs = get_package_list(ctx, config)[system_type]
excluded_packages = config.get('exclude_packages', list())
pkgs = list(set(pkgs).difference(set(excluded_packages)))
Expand All @@ -965,6 +972,7 @@ def upgrade_common(ctx, config, deploy_style):

deploy_style(ctx, node, remote, pkgs, system_type)
verify_package_version(ctx, node, remote)

return len(remotes)

docstring_for_upgrade = """"
Expand Down

0 comments on commit daff04b

Please sign in to comment.