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

Script cfgupgrade12

Tool to upgrade the configuration file.

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


Note: this has lots of duplicate content with cfgupgrade. Ideally, it should be merged.

Classes [hide private]
  Error
Generic exception
Functions [hide private]
 
SsconfName(key)
Returns the file name of an (old) ssconf key.
 
ReadFile(file_name, default=NoDefault)
Reads a file.
 
WriteFile(file_name, data)
Writes a configuration file.
 
GenerateSecret(all_secrets)
Generate an unique DRBD secret.
 
SetupLogging()
Configures the logging module.
 
Cluster12To20(cluster)
Upgrades the cluster object from 1.2 to 2.0.
 
Node12To20(node)
Upgrades a node from 1.2 to 2.0.
 
Instance12To20(drbd_minors, secrets, hypervisor, instance)
Upgrades an instance from 1.2 to 2.0.
 
Disk12To20(drbd_minors, secrets, disk)
Upgrades a disk from 1.2 to 2.0.
 
_ParseOptions()
 
_ComposePaths(oobj)
 
_WriteConfiguration(config_data, known_hosts)
 
main()
Main program.
Variables [hide private]
  options = None
hash(x)
  args = None
hash(x)
  NoDefault = object()
  INST_HV_CHG = {"hvm_pae": constants.HV_PAE, "vnc_bind_address"...
  INST_BE_CHG = {"vcpus": constants.BE_VCPUS, "memory": constant...
  F_SERIAL = "serial_no"

Imports: os, sys, optparse, logging, errno, constants, serializer, utils, cli, pathutils, version


Function Details [hide private]

GenerateSecret(all_secrets)

 

Generate an unique DRBD secret.

This is a copy from ConfigWriter.


Variables Details [hide private]

INST_HV_CHG

Value:
{"hvm_pae": constants.HV_PAE, "vnc_bind_address": constants.HV_VNC_BIN\
D_ADDRESS, "initrd_path": constants.HV_INITRD_PATH, "hvm_nic_type": co\
nstants.HV_NIC_TYPE, "kernel_path": constants.HV_KERNEL_PATH, "hvm_acp\
i": constants.HV_ACPI, "hvm_cdrom_image_path": constants.HV_CDROM_IMAG\
E_PATH, "hvm_boot_order": constants.HV_BOOT_ORDER, "hvm_disk_type": co\
nstants.HV_DISK_TYPE,}

INST_BE_CHG

Value:
{"vcpus": constants.BE_VCPUS, "memory": constants.BE_MEMORY, "auto_bal\
ance": constants.BE_AUTO_BALANCE,}