'auto_balance': constants.BE_AUTO_BALANCE,
}
+# Field names
+F_SERIAL = 'serial_no'
+
+
class Error(Exception):
"""Generic exception"""
pass
cluster['hvparams'] = constants.HVC_DEFAULTS
if 'beparams' not in cluster:
logging.info(" - adding beparams")
- cluster['beparams'] = {constants.BEGR_DEFAULT: constants.BEC_DEFAULTS}
+ cluster['beparams'] = {constants.PP_DEFAULT: constants.BEC_DEFAULTS}
# file storage
if 'file_storage_dir' not in cluster:
"""
logging.info("Upgrading node %s" % node['name'])
- if 'serial_no' not in node:
- node['serial_no'] = 1
+ if F_SERIAL not in node:
+ node[F_SERIAL] = 1
if 'master_candidate' not in node:
node['master_candidate'] = True
for key in 'offline', 'drained':
"""Upgrades an instance from 1.2 to 2.0.
"""
+ if F_SERIAL not in instance:
+ instance[F_SERIAL] = 1
+
if 'hypervisor' not in instance:
instance['hypervisor'] = hypervisor
old_config_version)
if 'version' not in config_data:
config_data['version'] = constants.BuildVersion(2, 0, 0)
- if 'serial_no' not in config_data:
- config_data['serial_no'] = 1
+ if F_SERIAL not in config_data:
+ config_data[F_SERIAL] = 1
# Make sure no instance uses remote_raid1 anymore
remote_raid1_instances = []