Script cfgupgrade
[hide private]
[frames] | no frames]

Script cfgupgrade

Tool to upgrade the configuration file.

This code handles only the types supported by simplejson. As an example, 'set' is a 'list'.

Classes [hide private]
  Error
Generic exception
Functions [hide private]
 
SetupLogging()
Configures the logging module.
 
CheckHostname(path)
Ensures hostname matches ssconf value.
 
_FillIPolicySpecs(default_ipolicy, ipolicy)
 
UpgradeIPolicy(ipolicy, default_ipolicy, isgroup)
 
UpgradeNetworks(config_data)
 
UpgradeCluster(config_data)
 
UpgradeGroups(config_data)
 
GetExclusiveStorageValue(config_data)
Return a conservative value of the exclusive_storage flag.
 
RemovePhysicalId(disk)
 
ChangeDiskDevType(disk, dev_type_map)
Replaces disk's dev_type attributes according to the given map.
 
UpgradeDiskDevType(disk)
Upgrades the disks' device type.
 
UpgradeInstances(config_data)
Upgrades the instances' configuration.
 
UpgradeRapiUsers()
 
UpgradeWatcher()
 
UpgradeFileStoragePaths(config_data)
 
GetNewNodeIndex(nodes_by_old_key, old_key, new_key_field)
 
ChangeNodeIndices(config_data, old_key_field, new_key_field)
 
ChangeInstanceIndices(config_data, old_key_field, new_key_field)
 
UpgradeNodeIndices(config_data)
 
UpgradeInstanceIndices(config_data)
 
UpgradeAll(config_data)
 
DowngradeNDParams(ndparams)
 
DowngradeNicParams(nicparams)
 
DowngradeHVParams(hvparams)
 
DowngradeCluster(config_data)
 
DowngradeNodeGroups(config_data)
 
DowngradeNodes(config_data)
 
DowngradeInstances(config_data)
 
DowngradeAll(config_data)
 
main()
Main program.
Variables [hide private]
  options = None
  args = None
  TARGET_MAJOR = 2
Target major version we will upgrade to
  TARGET_MINOR = 10
Target minor version we will upgrade to
  DOWNGRADE_MAJOR = 2
Target major version for downgrade
  DOWNGRADE_MINOR = 9
Target minor version for downgrade
  DEV_TYPE_OLD_NEW = {"lvm": constants.DT_PLAIN, "drbd8": consta...
  DEV_TYPE_NEW_OLD = dict((v, k) for k, v in DEV_TYPE_OLD_NEW.it...

Imports: os, sys, optparse, logging, time, StringIO, constants, serializer, utils, cli, bootstrap, config, netutils, pathutils, version


Function Details [hide private]

CheckHostname(path)

 

Ensures hostname matches ssconf value.

Parameters:
  • path - Path to ssconf file

GetExclusiveStorageValue(config_data)

 

Return a conservative value of the exclusive_storage flag.

Return True if the cluster or at least a nodegroup have the flag set.

ChangeDiskDevType(disk, dev_type_map)

 

Replaces disk's dev_type attributes according to the given map.

This can be used for both, up or downgrading the disks.


Variables Details [hide private]

DEV_TYPE_OLD_NEW

Value:
{"lvm": constants.DT_PLAIN, "drbd8": constants.DT_DRBD8}

DEV_TYPE_NEW_OLD

Value:
dict((v, k) for k, v in DEV_TYPE_OLD_NEW.items())