Revision 6f285030

b/tools/cfgupgrade
69 69
  'auto_balance': constants.BE_AUTO_BALANCE,
70 70
  }
71 71

  
72
# Field names
73
F_SERIAL = 'serial_no'
74

  
75

  
72 76
class Error(Exception):
73 77
  """Generic exception"""
74 78
  pass
......
197 201

  
198 202
  """
199 203
  logging.info("Upgrading node %s" % node['name'])
200
  if 'serial_no' not in node:
201
    node['serial_no'] = 1
204
  if F_SERIAL not in node:
205
    node[F_SERIAL] = 1
202 206
  if 'master_candidate' not in node:
203 207
    node['master_candidate'] = True
204 208
  for key in 'offline', 'drained':
......
210 214
  """Upgrades an instance from 1.2 to 2.0.
211 215

  
212 216
  """
217
  if F_SERIAL not in instance:
218
    instance[F_SERIAL] = 1
219

  
213 220
  if 'hypervisor' not in instance:
214 221
    instance['hypervisor'] = hypervisor
215 222

  
......
332 339
                  old_config_version)
333 340
    if 'version' not in config_data:
334 341
      config_data['version'] = constants.BuildVersion(2, 0, 0)
335
    if 'serial_no' not in config_data:
336
      config_data['serial_no'] = 1
342
    if F_SERIAL not in config_data:
343
      config_data[F_SERIAL] = 1
337 344

  
338 345
    # Make sure no instance uses remote_raid1 anymore
339 346
    remote_raid1_instances = []

Also available in: Unified diff