Commit de23298f authored by Klaus Aehlig's avatar Klaus Aehlig

On upgrades, check for upgrades to resume first

Make gnt-cluster upgrade refuse to upgrade if an upgrade to be resumed
is present. For the convenience of the user, consider an upgrade
command to the same target version as the upgrade to be resumed as an
equivalent way of saying that the pending upgrade is to be resumed.
Fixes issue 906.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 49fd9730
......@@ -2002,6 +2002,22 @@ def UpgradeGanetiCommand(opts, args):
" has to be given")
return 1
# If we're not told to resume, verify there is no upgrade
# in progress.
if not opts.resume:
oldversion, versionstring = _ReadIntentToUpgrade()
if versionstring is not None:
# An upgrade is going on; verify whether the target matches
if versionstring == opts.to:
ToStderr("An upgrade is already in progress. Target version matches,"
" resuming.")
opts.resume = True
opts.to = None
else:
ToStderr("An upgrade from %s to %s is in progress; use --resume to"
" finish it first" % (oldversion, versionstring))
return 1
oldversion = constants.RELEASE_VERSION
if opts.resume:
......
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