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

Script sanitize_config

Tool to sanitize/randomize the configuration file.

Functions [hide private]
Error(txt, *args)
Writes a message to standard error and exits.
GenerateNameMap(opts, names, base)
For a given set of names, generate a list of sane new names.
SanitizeSecrets(opts, cfg)
Cleanup configuration secrets.
SanitizeCluster(opts, cfg)
Sanitize the cluster names.
SanitizeNodes(opts, cfg)
Sanitize node names.
SanitizeInstances(opts, cfg)
Sanitize instance names.
SanitizeIps(opts, cfg)
Sanitize the IP names.
SanitizeOsNames(opts, cfg)
Sanitize the OS names.
SanitizeDisks(opts, cfg)
Cleanup disks disks.
Randomize a disks' secrets (if any).
RenameDiskNodes(disk, node_map)
Rename nodes in the disk config.
RenameDictKeys(a_dict, name_map, update_name)
Rename the dictionary keys based on a name map.
Main program.
Variables [hide private]
  OPTS = [cli.VERBOSE_OPT, cli_option("--path", help= "Convert t...

Imports: sys, os, optparse, constants, serializer, utils, pathutils, cli, cli_option

Function Details [hide private]

SanitizeIps(opts, cfg)


Sanitize the IP names.

Note: we're interested in obscuring the old IPs, not in generating actually valid new IPs, so we chose to simply put IPv4 addresses, irrelevant of whether IPv6 or IPv4 addresses existed before.

Variables Details [hide private]


[cli.VERBOSE_OPT, cli_option("--path", help= "Convert this configurati\
on file" " instead of '%s'" % pathutils.CLUSTER_CONF_FILE, default= pa\
thutils.CLUSTER_CONF_FILE, dest= "CONFIG_DATA_PATH"), cli_option("--sa\
nitize-names", default= "yes", type= "bool", help= "Randomize the clus\
ter, node and instance names [yes]"), cli_option("--sanitize-ips", def\
ault= "yes", type= "bool", help= "Randomize the cluster, node and inst\
ance IPs [yes]"), cli_option("--sanitize-lvs", default= "no", type= "b\
ool", help= "Randomize the LV names (for old clusters) [no]"), cli_opt\