Revision 93fd9bb1

b/test/cfgupgrade_unittest.py
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2010 Google Inc.
4
# Copyright (C) 2010, 2012 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
285 285
  def testUpgradeFrom_2_5(self):
286 286
    self._TestSimpleUpgrade(constants.BuildVersion(2, 5, 0), False)
287 287

  
288
  def testUpgradeFrom_2_6(self):
289
    self._TestSimpleUpgrade(constants.BuildVersion(2, 6, 0), False)
290

  
288 291
  def testUpgradeCurrent(self):
289 292
    self._TestSimpleUpgrade(constants.CONFIG_VERSION, False)
290 293

  
......
306 309
  def testUpgradeDryRunFrom_2_5(self):
307 310
    self._TestSimpleUpgrade(constants.BuildVersion(2, 5, 0), True)
308 311

  
312
  def testUpgradeDryRunFrom_2_6(self):
313
    self._TestSimpleUpgrade(constants.BuildVersion(2, 6, 0), True)
314

  
309 315
  def testUpgradeCurrentDryRun(self):
310 316
    self._TestSimpleUpgrade(constants.CONFIG_VERSION, True)
311 317

  
b/tools/cfgupgrade
1 1
#!/usr/bin/python
2 2
#
3 3

  
4
# Copyright (C) 2007, 2008, 2009, 2010 Google Inc.
4
# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc.
5 5
#
6 6
# This program is free software; you can redistribute it and/or modify
7 7
# it under the terms of the GNU General Public License as published by
......
46 46
args = None
47 47

  
48 48

  
49
#: Target major version we will upgrade to
50
TARGET_MAJOR = 2
51
#: Target minor version we will upgrade to
52
TARGET_MINOR = 6
53

  
54

  
49 55
class Error(Exception):
50 56
  """Generic exception"""
51 57
  pass
......
175 181
                " configuration file")
176 182

  
177 183
  # Upgrade from 2.0/2.1/2.2/2.3 to 2.4
178
  if config_major == 2 and config_minor in (0, 1, 2, 3, 4):
184
  if config_major == 2 and config_minor in (0, 1, 2, 3, 4, 5):
179 185
    if config_revision != 0:
180 186
      logging.warning("Config revision is %s, not 0", config_revision)
181 187

  
182
    config_data["version"] = constants.BuildVersion(2, 5, 0)
188
    config_data["version"] = constants.BuildVersion(TARGET_MAJOR,
189
                                                    TARGET_MINOR, 0)
183 190

  
184
  elif config_major == 2 and config_minor == 5:
191
  elif config_major == TARGET_MAJOR and config_minor == TARGET_MINOR:
185 192
    logging.info("No changes necessary")
186 193

  
187 194
  else:

Also available in: Unified diff