Our design states, that the intent-to-upgrade file contains "the current
version of ganeti, the version to change to, and the process ID". Make the
implementation fit with that design.
Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Petr Pudlak <pudlak@google.com>
contentstring = utils.ReadFile(pathutils.INTENT_TO_UPGRADE)
contents = utils.UnescapeAndSplit(contentstring)
- if len(contents) != 2:
+ if len(contents) != 3:
# file syntactically mal-formed
return None
- return contents[0]
+ return contents[1]
def _WriteIntentToUpgrade(version):
"""
utils.WriteFile(pathutils.INTENT_TO_UPGRADE,
- data=utils.EscapeAndJoin([version, "%d" % os.getpid()]))
+ data=utils.EscapeAndJoin([constants.RELEASE_VERSION, version,
+ "%d" % os.getpid()]))
def _UpgradeBeforeConfigurationChange(versionstring):