SOCAT_USE_COMPRESS = _constants.SOCAT_USE_COMPRESS
SOCAT_ESCAPE_CODE = _constants.SOCAT_ESCAPE_CODE
-#: Console as SSH command
-CONS_SSH = "ssh"
-#: Console as VNC server
-CONS_VNC = "vnc"
+CONS_SSH = _constants.CONS_SSH
+CONS_VNC = _constants.CONS_VNC
+CONS_SPICE = _constants.CONS_SPICE
+CONS_MESSAGE = _constants.CONS_MESSAGE
+CONS_ALL = _constants.CONS_ALL
-#: Console as SPICE server
-CONS_SPICE = "spice"
+RSA_KEY_BITS = _constants.RSA_KEY_BITS
+OPENSSL_CIPHERS = _constants.OPENSSL_CIPHERS
-#: Display a message for console access
-CONS_MESSAGE = "msg"
-
-#: All console types
-CONS_ALL = compat.UniqueFrozenset([
- CONS_SSH,
- CONS_VNC,
- CONS_SPICE,
- CONS_MESSAGE,
- ])
-
-# For RSA keys more bits are better, but they also make operations more
-# expensive. NIST SP 800-131 recommends a minimum of 2048 bits from the year
-# 2010 on.
-RSA_KEY_BITS = 2048
-
-# Ciphers allowed for SSL connections. For the format, see ciphers(1). A better
-# way to disable ciphers would be to use the exclamation mark (!), but socat
-# versions below 1.5 can't parse exclamation marks in options properly. When
-# modifying the ciphers, ensure not to accidentially add something after it's
-# been removed. Use the "openssl" utility to check the allowed ciphers, e.g.
-# "openssl ciphers -v HIGH:-DES".
-OPENSSL_CIPHERS = "HIGH:-DES:-3DES:-EXPORT:-ADH"
-
-# Digest used to sign certificates ("openssl x509" uses SHA1 by default)
-X509_CERT_SIGN_DIGEST = "SHA1"
-
-# Default validity of certificates in days
-X509_CERT_DEFAULT_VALIDITY = 365 * 5
-
-# commonName (CN) used in certificates
-X509_CERT_CN = "ganeti.example.com"
-
-X509_CERT_SIGNATURE_HEADER = "X-Ganeti-Signature"
+X509_CERT_SIGN_DIGEST = _constants.X509_CERT_SIGN_DIGEST
+X509_CERT_DEFAULT_VALIDITY = _constants.X509_CERT_DEFAULT_VALIDITY
+X509_CERT_CN = _constants.X509_CERT_CN
+X509_CERT_SIGNATURE_HEADER = _constants.X509_CERT_SIGNATURE_HEADER
# Import/export daemon mode
-IEM_IMPORT = "import"
-IEM_EXPORT = "export"
+IEM_IMPORT = _constants.IEM_IMPORT
+IEM_EXPORT = _constants.IEM_EXPORT
# Import/export transport compression
-IEC_NONE = "none"
-IEC_GZIP = "gzip"
-IEC_ALL = compat.UniqueFrozenset([
- IEC_NONE,
- IEC_GZIP,
- ])
+IEC_NONE = _constants.IEC_NONE
+IEC_GZIP = _constants.IEC_GZIP
+IEC_ALL = _constants.IEC_ALL
-IE_CUSTOM_SIZE = "fd"
+IE_CUSTOM_SIZE = _constants.IE_CUSTOM_SIZE
IE_MAGIC_RE = re.compile(r"^[-_.a-zA-Z0-9]{5,100}$")
-# Import/export I/O
-# Direct file I/O, equivalent to a shell's I/O redirection using '<' or '>'
-IEIO_FILE = "file"
-# Raw block device I/O using "dd"
-IEIO_RAW_DISK = "raw"
-# OS definition import/export script
-IEIO_SCRIPT = "script"
+IEIO_FILE = _constants.IEIO_FILE
+IEIO_RAW_DISK = _constants.IEIO_RAW_DISK
+IEIO_SCRIPT = _constants.IEIO_SCRIPT
VALUE_DEFAULT = "default"
VALUE_AUTO = "auto"
# External script validation mask
EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
-# hooks-related constants
-HOOKS_PHASE_PRE = "pre"
-HOOKS_PHASE_POST = "post"
-HOOKS_NAME_CFGUPDATE = "config-update"
-HOOKS_NAME_WATCHER = "watcher"
-HOOKS_VERSION = 2
-HOOKS_PATH = "/sbin:/bin:/usr/sbin:/usr/bin"
-
-# hooks subject type (what object type does the LU deal with)
-HTYPE_CLUSTER = "CLUSTER"
-HTYPE_NODE = "NODE"
-HTYPE_GROUP = "GROUP"
-HTYPE_INSTANCE = "INSTANCE"
-HTYPE_NETWORK = "NETWORK"
-
-HKR_SKIP = 0
-HKR_FAIL = 1
-HKR_SUCCESS = 2
+HOOKS_PHASE_PRE = _constants.HOOKS_PHASE_PRE
+HOOKS_PHASE_POST = _constants.HOOKS_PHASE_POST
+HOOKS_NAME_CFGUPDATE = _constants.HOOKS_NAME_CFGUPDATE
+HOOKS_NAME_WATCHER = _constants.HOOKS_NAME_WATCHER
+HOOKS_VERSION = _constants.HOOKS_VERSION
+HOOKS_PATH = _constants.HOOKS_PATH
+
+HTYPE_CLUSTER = _constants.HTYPE_CLUSTER
+HTYPE_NODE = _constants.HTYPE_NODE
+HTYPE_GROUP = _constants.HTYPE_GROUP
+HTYPE_INSTANCE = _constants.HTYPE_INSTANCE
+HTYPE_NETWORK = _constants.HTYPE_NETWORK
+
+HKR_SKIP = _constants.HKR_SKIP
+HKR_FAIL = _constants.HKR_FAIL
+HKR_SUCCESS = _constants.HKR_SUCCESS
# Storage types
ST_BLOCK = _constants.ST_BLOCK
ST_LVM_VG = _constants.ST_LVM_VG
ST_RADOS = _constants.ST_RADOS
STORAGE_TYPES = _constants.STORAGE_TYPES
-
-# the set of storage types for which storage reporting is available
-# FIXME: Remove this, once storage reporting is available for all types.
-STS_REPORT = compat.UniqueFrozenset([ST_FILE, ST_LVM_PV, ST_LVM_VG])
+STS_REPORT = _constants.STS_REPORT
# Storage fields
# first two are valid in LU context only, not passed to backend
SF_FREE = _constants.SF_FREE
SF_USED = _constants.SF_USED
SF_ALLOCATABLE = _constants.SF_ALLOCATABLE
+VALID_STORAGE_FIELDS = _constants.VALID_STORAGE_FIELDS
+MODIFIABLE_STORAGE_FIELDS = _constants.MODIFIABLE_STORAGE_FIELDS
-# Storage operations
-SO_FIX_CONSISTENCY = "fix-consistency"
-
-# Available fields per storage type
-VALID_STORAGE_FIELDS = compat.UniqueFrozenset([
- SF_NODE,
- SF_NAME,
- SF_TYPE,
- SF_SIZE,
- SF_USED,
- SF_FREE,
- SF_ALLOCATABLE,
- ])
+SO_FIX_CONSISTENCY = _constants.SO_FIX_CONSISTENCY
+VALID_STORAGE_OPERATIONS = _constants.VALID_STORAGE_OPERATIONS
-MODIFIABLE_STORAGE_FIELDS = {
- ST_LVM_PV: frozenset([SF_ALLOCATABLE]),
- }
+VF_DEV = _constants.VF_DEV
+VF_INSTANCE = _constants.VF_INSTANCE
+VF_NAME = _constants.VF_NAME
+VF_NODE = _constants.VF_NODE
+VF_PHYS = _constants.VF_PHYS
+VF_SIZE = _constants.VF_SIZE
+VF_VG = _constants.VF_VG
LDS_OKAY = _constants.LDS_OKAY
LDS_UNKNOWN = _constants.LDS_UNKNOWN
LDS_FAULTY = _constants.LDS_FAULTY
LDS_NAMES = _constants.LDS_NAMES
-VALID_STORAGE_OPERATIONS = {
- ST_LVM_VG: frozenset([SO_FIX_CONSISTENCY]),
- }
-
-# Volume fields
-VF_DEV = "dev"
-VF_INSTANCE = "instance"
-VF_NAME = "name"
-VF_NODE = "node"
-VF_PHYS = "phys"
-VF_SIZE = "size"
-VF_VG = "vg"
# disk template types
DT_BLOCK = _constants.DT_BLOCK
DISK_TEMPLATES = _constants.DISK_TEMPLATES
DEFAULT_ENABLED_DISK_TEMPLATES = _constants.DEFAULT_ENABLED_DISK_TEMPLATES
-# mapping of disk templates to storage types
-MAP_DISK_TEMPLATE_STORAGE_TYPE = {
- DT_BLOCK: ST_BLOCK,
- DT_DISKLESS: ST_DISKLESS,
- DT_DRBD8: ST_LVM_VG,
- DT_EXT: ST_EXT,
- DT_FILE: ST_FILE,
- DT_PLAIN: ST_LVM_VG,
- DT_RBD: ST_RADOS,
- DT_SHARED_FILE: ST_FILE,
- }
-
-
-# drbd constants
-DRBD_HMAC_ALG = "md5"
-DRBD_DEFAULT_NET_PROTOCOL = "C"
-DRBD_MIGRATION_NET_PROTOCOL = "C"
-DRBD_STATUS_FILE = "/proc/drbd"
-
-#: Size of DRBD meta block device
-DRBD_META_SIZE = 128
+MAP_DISK_TEMPLATE_STORAGE_TYPE = _constants.MAP_DISK_TEMPLATE_STORAGE_TYPE
DTS_INT_MIRROR = _constants.DTS_INT_MIRROR
DTS_EXT_MIRROR = _constants.DTS_EXT_MIRROR
DTS_EXCL_STORAGE = _constants.DTS_EXCL_STORAGE
DTS_NO_FREE_SPACE_CHECK = _constants.DTS_NO_FREE_SPACE_CHECK
DTS_BLOCK = _constants.DTS_BLOCK
-# drbd barrier types
-DRBD_B_NONE = "n"
-DRBD_B_DISK_BARRIERS = "b"
-DRBD_B_DISK_DRAIN = "d"
-DRBD_B_DISK_FLUSH = "f"
+
+DRBD_HMAC_ALG = _constants.DRBD_HMAC_ALG
+DRBD_DEFAULT_NET_PROTOCOL = _constants.DRBD_DEFAULT_NET_PROTOCOL
+DRBD_MIGRATION_NET_PROTOCOL = _constants.DRBD_MIGRATION_NET_PROTOCOL
+DRBD_STATUS_FILE = _constants.DRBD_STATUS_FILE
+DRBD_META_SIZE = _constants.DRBD_META_SIZE
+
+DRBD_B_NONE = _constants.DRBD_B_NONE
+DRBD_B_DISK_BARRIERS = _constants.DRBD_B_DISK_BARRIERS
+DRBD_B_DISK_DRAIN = _constants.DRBD_B_DISK_DRAIN
+DRBD_B_DISK_FLUSH = _constants.DRBD_B_DISK_FLUSH
# Valid barrier combinations: "n" or any non-null subset of "bfd"
DRBD_VALID_BARRIER_OPT = compat.UniqueFrozenset([
frozenset([DRBD_B_DISK_BARRIERS, DRBD_B_DISK_FLUSH, DRBD_B_DISK_DRAIN]),
])
-# rbd tool command
-RBD_CMD = "rbd"
+RBD_CMD = _constants.RBD_CMD
FD_BLKTAP = _constants.FD_BLKTAP
FD_LOOP = _constants.FD_LOOP
INSTANCE_REMOTE_IMPORT = _constants.INSTANCE_REMOTE_IMPORT
INSTANCE_CREATE_MODES = _constants.INSTANCE_CREATE_MODES
-# Remote import/export handshake message and version
-RIE_VERSION = 0
-RIE_HANDSHAKE = "Hi, I'm Ganeti"
-
-# Remote import/export certificate validity in seconds
-RIE_CERT_VALIDITY = 24 * 60 * 60
-
-# Overall timeout for establishing connection
-RIE_CONNECT_TIMEOUT = 180
+RIE_VERSION = _constants.RIE_VERSION
+RIE_HANDSHAKE = _constants.RIE_HANDSHAKE
+RIE_CERT_VALIDITY = _constants.RIE_CERT_VALIDITY
+RIE_CONNECT_TIMEOUT = _constants.RIE_CONNECT_TIMEOUT
+RIE_CONNECT_ATTEMPT_TIMEOUT = _constants.RIE_CONNECT_ATTEMPT_TIMEOUT
+RIE_CONNECT_RETRIES = _constants.RIE_CONNECT_RETRIES
+CHILD_LINGER_TIMEOUT = _constants.CHILD_LINGER_TIMEOUT
-# Export only: how long to wait per connection attempt (seconds)
-RIE_CONNECT_ATTEMPT_TIMEOUT = 20
-
-# Export only: number of attempts to connect
-RIE_CONNECT_RETRIES = 10
-
-#: Give child process up to 5 seconds to exit after sending a signal
-CHILD_LINGER_TIMEOUT = 5.0
-
-
-# import/export config options
-INISECT_EXP = "export"
-INISECT_INS = "instance"
-INISECT_HYP = "hypervisor"
-INISECT_BEP = "backend"
-INISECT_OSP = "os"
+INISECT_EXP = _constants.INISECT_EXP
+INISECT_INS = _constants.INISECT_INS
+INISECT_HYP = _constants.INISECT_HYP
+INISECT_BEP = _constants.INISECT_BEP
+INISECT_OSP = _constants.INISECT_OSP
# dynamic device modification
DDM_ADD = _constants.DDM_ADD
EXIT_NOTCLUSTER = _constants.EXIT_NOTCLUSTER
EXIT_NOTMASTER = _constants.EXIT_NOTMASTER
EXIT_NODESETUP_ERROR = _constants.EXIT_NODESETUP_ERROR
-EXIT_CONFIRMATION = _constants.EXIT_CONFIRMATION # need user confirmation
-
-#: Exit code for query operations with unknown fields
+EXIT_CONFIRMATION = _constants.EXIT_CONFIRMATION
EXIT_UNKNOWN_FIELD = _constants.EXIT_UNKNOWN_FIELD
# tags
MAX_TAGS_PER_OBJ = _constants.MAX_TAGS_PER_OBJ
# others
-DEFAULT_BRIDGE = "xen-br0"
-DEFAULT_OVS = "switch1"
-CLASSIC_DRBD_SYNC_SPEED = 60 * 1024 # 60 MiB, expressed in KiB
-IP4_ADDRESS_LOCALHOST = "127.0.0.1"
-IP4_ADDRESS_ANY = "0.0.0.0"
-IP6_ADDRESS_LOCALHOST = "::1"
-IP6_ADDRESS_ANY = "::"
-IP4_VERSION = 4
-IP6_VERSION = 6
-VALID_IP_VERSIONS = compat.UniqueFrozenset([IP4_VERSION, IP6_VERSION])
+DEFAULT_BRIDGE = _constants.DEFAULT_BRIDGE
+DEFAULT_OVS = _constants.DEFAULT_OVS
+CLASSIC_DRBD_SYNC_SPEED = _constants.CLASSIC_DRBD_SYNC_SPEED
+IP4_ADDRESS_LOCALHOST = _constants.IP4_ADDRESS_LOCALHOST
+IP4_ADDRESS_ANY = _constants.IP4_ADDRESS_ANY
+IP6_ADDRESS_LOCALHOST = _constants.IP6_ADDRESS_LOCALHOST
+IP6_ADDRESS_ANY = _constants.IP6_ADDRESS_ANY
+IP4_VERSION = _constants.IP4_VERSION
+IP6_VERSION = _constants.IP6_VERSION
+VALID_IP_VERSIONS = _constants.VALID_IP_VERSIONS
# for export to htools
IP4_FAMILY = socket.AF_INET
IP6_FAMILY = socket.AF_INET6
-TCP_PING_TIMEOUT = 10
-DEFAULT_VG = "xenvg"
-DEFAULT_DRBD_HELPER = "/bin/true"
-MIN_VG_SIZE = 20480
-DEFAULT_MAC_PREFIX = "aa:00:00"
-# default maximum instance wait time, in seconds.
-DEFAULT_SHUTDOWN_TIMEOUT = 120
+TCP_PING_TIMEOUT = _constants.TCP_PING_TIMEOUT
+DEFAULT_VG = _constants.DEFAULT_VG
+DEFAULT_DRBD_HELPER = _constants.DEFAULT_DRBD_HELPER
+MIN_VG_SIZE = _constants.MIN_VG_SIZE
+DEFAULT_MAC_PREFIX = _constants.DEFAULT_MAC_PREFIX
+DEFAULT_SHUTDOWN_TIMEOUT = _constants.DEFAULT_SHUTDOWN_TIMEOUT
NODE_MAX_CLOCK_SKEW = _constants.NODE_MAX_CLOCK_SKEW
-# Time for an intra-cluster disk transfer to wait for a connection
-DISK_TRANSFER_CONNECT_TIMEOUT = 60
-# Disk index separator
+DISK_TRANSFER_CONNECT_TIMEOUT = _constants.DISK_TRANSFER_CONNECT_TIMEOUT
DISK_SEPARATOR = _constants.DISK_SEPARATOR
IP_COMMAND_PATH = _constants.IP_COMMAND_PATH
+JOB_IDS_KEY = _constants.JOB_IDS_KEY
+
+RUNPARTS_SKIP = _constants.RUNPARTS_SKIP
+RUNPARTS_RUN = _constants.RUNPARTS_RUN
+RUNPARTS_ERR = _constants.RUNPARTS_ERR
+RUNPARTS_STATUS = _constants.RUNPARTS_STATUS
+
+RPC_ENCODING_NONE = _constants.RPC_ENCODING_NONE
+RPC_ENCODING_ZLIB_BASE64 = _constants.RPC_ENCODING_ZLIB_BASE64
RPC_TMO_URGENT = _constants.RPC_TMO_URGENT
RPC_TMO_FAST = _constants.RPC_TMO_FAST
RPC_TMO_1DAY = _constants.RPC_TMO_1DAY
RPC_CONNECT_TIMEOUT = _constants.RPC_CONNECT_TIMEOUT
-#: Key for job IDs in opcode result
-JOB_IDS_KEY = "jobs"
-
-# runparts results
-(RUNPARTS_SKIP,
- RUNPARTS_RUN,
- RUNPARTS_ERR) = range(3)
-
-RUNPARTS_STATUS = compat.UniqueFrozenset([
- RUNPARTS_SKIP,
- RUNPARTS_RUN,
- RUNPARTS_ERR,
- ])
-
-# RPC constants
-(RPC_ENCODING_NONE,
- RPC_ENCODING_ZLIB_BASE64) = range(2)
-
-# os related constants
-OS_SCRIPT_CREATE = "create"
-OS_SCRIPT_IMPORT = "import"
-OS_SCRIPT_EXPORT = "export"
-OS_SCRIPT_RENAME = "rename"
-OS_SCRIPT_VERIFY = "verify"
-OS_SCRIPTS = compat.UniqueFrozenset([
- OS_SCRIPT_CREATE,
- OS_SCRIPT_IMPORT,
- OS_SCRIPT_EXPORT,
- OS_SCRIPT_RENAME,
- OS_SCRIPT_VERIFY,
- ])
-
-OS_API_FILE = "ganeti_api_version"
-OS_VARIANTS_FILE = "variants.list"
-OS_PARAMETERS_FILE = "parameters.list"
-
-OS_VALIDATE_PARAMETERS = "parameters"
-OS_VALIDATE_CALLS = compat.UniqueFrozenset([OS_VALIDATE_PARAMETERS])
-
-# External Storage (ES) related constants
-ES_ACTION_CREATE = "create"
-ES_ACTION_REMOVE = "remove"
-ES_ACTION_GROW = "grow"
-ES_ACTION_ATTACH = "attach"
-ES_ACTION_DETACH = "detach"
-ES_ACTION_SETINFO = "setinfo"
-ES_ACTION_VERIFY = "verify"
-
-ES_SCRIPT_CREATE = ES_ACTION_CREATE
-ES_SCRIPT_REMOVE = ES_ACTION_REMOVE
-ES_SCRIPT_GROW = ES_ACTION_GROW
-ES_SCRIPT_ATTACH = ES_ACTION_ATTACH
-ES_SCRIPT_DETACH = ES_ACTION_DETACH
-ES_SCRIPT_SETINFO = ES_ACTION_SETINFO
-ES_SCRIPT_VERIFY = ES_ACTION_VERIFY
-ES_SCRIPTS = frozenset([
- ES_SCRIPT_CREATE,
- ES_SCRIPT_REMOVE,
- ES_SCRIPT_GROW,
- ES_SCRIPT_ATTACH,
- ES_SCRIPT_DETACH,
- ES_SCRIPT_SETINFO,
- ES_SCRIPT_VERIFY
- ])
-
-ES_PARAMETERS_FILE = "parameters.list"
+OS_SCRIPT_CREATE = _constants.OS_SCRIPT_CREATE
+OS_SCRIPT_IMPORT = _constants.OS_SCRIPT_IMPORT
+OS_SCRIPT_EXPORT = _constants.OS_SCRIPT_EXPORT
+OS_SCRIPT_RENAME = _constants.OS_SCRIPT_RENAME
+OS_SCRIPT_VERIFY = _constants.OS_SCRIPT_VERIFY
+OS_SCRIPTS = _constants.OS_SCRIPTS
+
+OS_API_FILE = _constants.OS_API_FILE
+OS_VARIANTS_FILE = _constants.OS_VARIANTS_FILE
+OS_PARAMETERS_FILE = _constants.OS_PARAMETERS_FILE
+
+OS_VALIDATE_PARAMETERS = _constants.OS_VALIDATE_PARAMETERS
+OS_VALIDATE_CALLS = _constants.OS_VALIDATE_CALLS
+
+ES_ACTION_CREATE = _constants.ES_ACTION_CREATE
+ES_ACTION_REMOVE = _constants.ES_ACTION_REMOVE
+ES_ACTION_GROW = _constants.ES_ACTION_GROW
+ES_ACTION_ATTACH = _constants.ES_ACTION_ATTACH
+ES_ACTION_DETACH = _constants.ES_ACTION_DETACH
+ES_ACTION_SETINFO = _constants.ES_ACTION_SETINFO
+ES_ACTION_VERIFY = _constants.ES_ACTION_VERIFY
+
+ES_SCRIPT_CREATE = _constants.ES_SCRIPT_CREATE
+ES_SCRIPT_REMOVE = _constants.ES_SCRIPT_REMOVE
+ES_SCRIPT_GROW = _constants.ES_SCRIPT_GROW
+ES_SCRIPT_ATTACH = _constants.ES_SCRIPT_ATTACH
+ES_SCRIPT_DETACH = _constants.ES_SCRIPT_DETACH
+ES_SCRIPT_SETINFO = _constants.ES_SCRIPT_SETINFO
+ES_SCRIPT_VERIFY = _constants.ES_SCRIPT_VERIFY
+ES_SCRIPTS = _constants.ES_SCRIPTS
+
+ES_PARAMETERS_FILE = _constants.ES_PARAMETERS_FILE
# reboot types
INSTANCE_REBOOT_SOFT = _constants.INSTANCE_REBOOT_SOFT
INSTANCE_REBOOT_FULL = _constants.INSTANCE_REBOOT_FULL
REBOOT_TYPES = _constants.REBOOT_TYPES
-# instance reboot behaviors
-INSTANCE_REBOOT_ALLOWED = "reboot"
-INSTANCE_REBOOT_EXIT = "exit"
-
-REBOOT_BEHAVIORS = compat.UniqueFrozenset([
- INSTANCE_REBOOT_ALLOWED,
- INSTANCE_REBOOT_EXIT,
- ])
+INSTANCE_REBOOT_ALLOWED = _constants.INSTANCE_REBOOT_ALLOWED
+INSTANCE_REBOOT_EXIT = _constants.INSTANCE_REBOOT_EXIT
+REBOOT_BEHAVIORS = _constants.REBOOT_BEHAVIORS
VTYPE_STRING = _constants.VTYPE_STRING
VTYPE_MAYBE_STRING = _constants.VTYPE_MAYBE_STRING
VTYPE_INT = _constants.VTYPE_INT
ENFORCEABLE_TYPES = _constants.ENFORCEABLE_TYPES
-# Constant representing that the user does not specify any IP version
-IFACE_NO_IP_VERSION_SPECIFIED = 0
-
-VALID_SERIAL_SPEEDS = compat.UniqueFrozenset([
- 75,
- 110,
- 300,
- 600,
- 1200,
- 1800,
- 2400,
- 4800,
- 9600,
- 14400,
- 19200,
- 28800,
- 38400,
- 57600,
- 115200,
- 230400,
- 345600,
- 460800,
- ])
-
-# HV parameter names (global namespace)
-HV_BOOT_ORDER = "boot_order"
-HV_CDROM_IMAGE_PATH = "cdrom_image_path"
-HV_KVM_CDROM2_IMAGE_PATH = "cdrom2_image_path"
-HV_KVM_FLOPPY_IMAGE_PATH = "floppy_image_path"
-HV_NIC_TYPE = "nic_type"
-HV_DISK_TYPE = "disk_type"
-HV_KVM_CDROM_DISK_TYPE = "cdrom_disk_type"
-HV_VNC_BIND_ADDRESS = "vnc_bind_address"
-HV_VNC_PASSWORD_FILE = "vnc_password_file"
-HV_VNC_TLS = "vnc_tls"
-HV_VNC_X509 = "vnc_x509_path"
-HV_VNC_X509_VERIFY = "vnc_x509_verify"
-HV_KVM_SPICE_BIND = "spice_bind"
-HV_KVM_SPICE_IP_VERSION = "spice_ip_version"
-HV_KVM_SPICE_PASSWORD_FILE = "spice_password_file"
-HV_KVM_SPICE_LOSSLESS_IMG_COMPR = "spice_image_compression"
-HV_KVM_SPICE_JPEG_IMG_COMPR = "spice_jpeg_wan_compression"
-HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR = "spice_zlib_glz_wan_compression"
-HV_KVM_SPICE_STREAMING_VIDEO_DETECTION = "spice_streaming_video"
-HV_KVM_SPICE_AUDIO_COMPR = "spice_playback_compression"
-HV_KVM_SPICE_USE_TLS = "spice_use_tls"
-HV_KVM_SPICE_TLS_CIPHERS = "spice_tls_ciphers"
-HV_KVM_SPICE_USE_VDAGENT = "spice_use_vdagent"
-HV_ACPI = "acpi"
-HV_PAE = "pae"
-HV_USE_BOOTLOADER = "use_bootloader"
-HV_BOOTLOADER_ARGS = "bootloader_args"
-HV_BOOTLOADER_PATH = "bootloader_path"
-HV_KERNEL_ARGS = "kernel_args"
-HV_KERNEL_PATH = "kernel_path"
-HV_INITRD_PATH = "initrd_path"
-HV_ROOT_PATH = "root_path"
-HV_SERIAL_CONSOLE = "serial_console"
-HV_SERIAL_SPEED = "serial_speed"
-HV_USB_MOUSE = "usb_mouse"
-HV_KEYMAP = "keymap"
-HV_DEVICE_MODEL = "device_model"
-HV_INIT_SCRIPT = "init_script"
-HV_MIGRATION_PORT = "migration_port"
-HV_MIGRATION_BANDWIDTH = "migration_bandwidth"
-HV_MIGRATION_DOWNTIME = "migration_downtime"
-HV_MIGRATION_MODE = "migration_mode"
-HV_USE_LOCALTIME = "use_localtime"
-HV_DISK_CACHE = "disk_cache"
-HV_SECURITY_MODEL = "security_model"
-HV_SECURITY_DOMAIN = "security_domain"
-HV_KVM_FLAG = "kvm_flag"
-HV_VHOST_NET = "vhost_net"
-HV_KVM_USE_CHROOT = "use_chroot"
-HV_CPU_MASK = "cpu_mask"
-HV_MEM_PATH = "mem_path"
-HV_PASSTHROUGH = "pci_pass"
-HV_BLOCKDEV_PREFIX = "blockdev_prefix"
-HV_REBOOT_BEHAVIOR = "reboot_behavior"
-HV_CPU_TYPE = "cpu_type"
-HV_CPU_CAP = "cpu_cap"
-HV_CPU_WEIGHT = "cpu_weight"
-HV_CPU_CORES = "cpu_cores"
-HV_CPU_THREADS = "cpu_threads"
-HV_CPU_SOCKETS = "cpu_sockets"
-HV_SOUNDHW = "soundhw"
-HV_USB_DEVICES = "usb_devices"
-HV_VGA = "vga"
-HV_KVM_EXTRA = "kvm_extra"
-HV_KVM_MACHINE_VERSION = "machine_version"
-HV_KVM_PATH = "kvm_path"
-HV_VIF_TYPE = "vif_type"
-HV_VIF_SCRIPT = "vif_script"
-HV_XEN_CMD = "xen_cmd"
-HV_XEN_CPUID = "cpuid"
-HV_VNET_HDR = "vnet_hdr"
-HV_VIRIDIAN = "viridian"
-
+IFACE_NO_IP_VERSION_SPECIFIED = _constants.IFACE_NO_IP_VERSION_SPECIFIED
+
+VALID_SERIAL_SPEEDS = _constants.VALID_SERIAL_SPEEDS
+
+HV_BOOT_ORDER = _constants.HV_BOOT_ORDER
+HV_CDROM_IMAGE_PATH = _constants.HV_CDROM_IMAGE_PATH
+HV_KVM_CDROM2_IMAGE_PATH = _constants.HV_KVM_CDROM2_IMAGE_PATH
+HV_KVM_FLOPPY_IMAGE_PATH = _constants.HV_KVM_FLOPPY_IMAGE_PATH
+HV_NIC_TYPE = _constants.HV_NIC_TYPE
+HV_DISK_TYPE = _constants.HV_DISK_TYPE
+HV_KVM_CDROM_DISK_TYPE = _constants.HV_KVM_CDROM_DISK_TYPE
+HV_VNC_BIND_ADDRESS = _constants.HV_VNC_BIND_ADDRESS
+HV_VNC_PASSWORD_FILE = _constants.HV_VNC_PASSWORD_FILE
+HV_VNC_TLS = _constants.HV_VNC_TLS
+HV_VNC_X509 = _constants.HV_VNC_X509
+HV_VNC_X509_VERIFY = _constants.HV_VNC_X509_VERIFY
+HV_KVM_SPICE_BIND = _constants.HV_KVM_SPICE_BIND
+HV_KVM_SPICE_IP_VERSION = _constants.HV_KVM_SPICE_IP_VERSION
+HV_KVM_SPICE_PASSWORD_FILE = _constants.HV_KVM_SPICE_PASSWORD_FILE
+HV_KVM_SPICE_LOSSLESS_IMG_COMPR = _constants.HV_KVM_SPICE_LOSSLESS_IMG_COMPR
+HV_KVM_SPICE_JPEG_IMG_COMPR = _constants.HV_KVM_SPICE_JPEG_IMG_COMPR
+HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR = _constants.HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR
+HV_KVM_SPICE_STREAMING_VIDEO_DETECTION = \
+ _constants.HV_KVM_SPICE_STREAMING_VIDEO_DETECTION
+HV_KVM_SPICE_AUDIO_COMPR = _constants.HV_KVM_SPICE_AUDIO_COMPR
+HV_KVM_SPICE_USE_TLS = _constants.HV_KVM_SPICE_USE_TLS
+HV_KVM_SPICE_TLS_CIPHERS = _constants.HV_KVM_SPICE_TLS_CIPHERS
+HV_KVM_SPICE_USE_VDAGENT = _constants.HV_KVM_SPICE_USE_VDAGENT
+HV_ACPI = _constants.HV_ACPI
+HV_PAE = _constants.HV_PAE
+HV_USE_BOOTLOADER = _constants.HV_USE_BOOTLOADER
+HV_BOOTLOADER_ARGS = _constants.HV_BOOTLOADER_ARGS
+HV_BOOTLOADER_PATH = _constants.HV_BOOTLOADER_PATH
+HV_KERNEL_ARGS = _constants.HV_KERNEL_ARGS
+HV_KERNEL_PATH = _constants.HV_KERNEL_PATH
+HV_INITRD_PATH = _constants.HV_INITRD_PATH
+HV_ROOT_PATH = _constants.HV_ROOT_PATH
+HV_SERIAL_CONSOLE = _constants.HV_SERIAL_CONSOLE
+HV_SERIAL_SPEED = _constants.HV_SERIAL_SPEED
+HV_USB_MOUSE = _constants.HV_USB_MOUSE
+HV_KEYMAP = _constants.HV_KEYMAP
+HV_DEVICE_MODEL = _constants.HV_DEVICE_MODEL
+HV_INIT_SCRIPT = _constants.HV_INIT_SCRIPT
+HV_MIGRATION_PORT = _constants.HV_MIGRATION_PORT
+HV_MIGRATION_BANDWIDTH = _constants.HV_MIGRATION_BANDWIDTH
+HV_MIGRATION_DOWNTIME = _constants.HV_MIGRATION_DOWNTIME
+HV_MIGRATION_MODE = _constants.HV_MIGRATION_MODE
+HV_USE_LOCALTIME = _constants.HV_USE_LOCALTIME
+HV_DISK_CACHE = _constants.HV_DISK_CACHE
+HV_SECURITY_MODEL = _constants.HV_SECURITY_MODEL
+HV_SECURITY_DOMAIN = _constants.HV_SECURITY_DOMAIN
+HV_KVM_FLAG = _constants.HV_KVM_FLAG
+HV_VHOST_NET = _constants.HV_VHOST_NET
+HV_KVM_USE_CHROOT = _constants.HV_KVM_USE_CHROOT
+HV_CPU_MASK = _constants.HV_CPU_MASK
+HV_MEM_PATH = _constants.HV_MEM_PATH
+HV_PASSTHROUGH = _constants.HV_PASSTHROUGH
+HV_BLOCKDEV_PREFIX = _constants.HV_BLOCKDEV_PREFIX
+HV_REBOOT_BEHAVIOR = _constants.HV_REBOOT_BEHAVIOR
+HV_CPU_TYPE = _constants.HV_CPU_TYPE
+HV_CPU_CAP = _constants.HV_CPU_CAP
+HV_CPU_WEIGHT = _constants.HV_CPU_WEIGHT
+HV_CPU_CORES = _constants.HV_CPU_CORES
+HV_CPU_THREADS = _constants.HV_CPU_THREADS
+HV_CPU_SOCKETS = _constants.HV_CPU_SOCKETS
+HV_SOUNDHW = _constants.HV_SOUNDHW
+HV_USB_DEVICES = _constants.HV_USB_DEVICES
+HV_VGA = _constants.HV_VGA
+HV_KVM_EXTRA = _constants.HV_KVM_EXTRA
+HV_KVM_MACHINE_VERSION = _constants.HV_KVM_MACHINE_VERSION
+HV_KVM_PATH = _constants.HV_KVM_PATH
+HV_VIF_TYPE = _constants.HV_VIF_TYPE
+HV_VIF_SCRIPT = _constants.HV_VIF_SCRIPT
+HV_XEN_CMD = _constants.HV_XEN_CMD
+HV_XEN_CPUID = _constants.HV_XEN_CPUID
+HV_VNET_HDR = _constants.HV_VNET_HDR
+HV_VIRIDIAN = _constants.HV_VIRIDIAN
HVS_PARAMETER_TYPES = {
HV_KVM_PATH: VTYPE_STRING,
HVS_PARAMETERS = frozenset(HVS_PARAMETER_TYPES.keys())
-HVS_PARAMETER_TITLES = {
- HV_ACPI: "ACPI",
- HV_BOOT_ORDER: "Boot_order",
- HV_CDROM_IMAGE_PATH: "CDROM_image_path",
- HV_DISK_TYPE: "Disk_type",
- HV_INITRD_PATH: "Initrd_path",
- HV_KERNEL_PATH: "Kernel_path",
- HV_NIC_TYPE: "NIC_type",
- HV_PAE: "PAE",
- HV_VNC_BIND_ADDRESS: "VNC_bind_address",
- HV_PASSTHROUGH: "pci_pass",
- HV_CPU_TYPE: "cpu_type",
- }
-
-# Migration statuses
-HV_MIGRATION_COMPLETED = "completed"
-HV_MIGRATION_ACTIVE = "active"
-HV_MIGRATION_FAILED = "failed"
-HV_MIGRATION_CANCELLED = "cancelled"
-
-HV_MIGRATION_VALID_STATUSES = compat.UniqueFrozenset([
- HV_MIGRATION_COMPLETED,
- HV_MIGRATION_ACTIVE,
- HV_MIGRATION_FAILED,
- HV_MIGRATION_CANCELLED,
- ])
-
-HV_MIGRATION_FAILED_STATUSES = compat.UniqueFrozenset([
- HV_MIGRATION_FAILED,
- HV_MIGRATION_CANCELLED,
- ])
-
-# KVM-specific statuses
-HV_KVM_MIGRATION_VALID_STATUSES = HV_MIGRATION_VALID_STATUSES
-
-# Node info keys
-HV_NODEINFO_KEY_VERSION = "hv_version"
-
-# Hypervisor state
-HVST_MEMORY_TOTAL = "mem_total"
-HVST_MEMORY_NODE = "mem_node"
-HVST_MEMORY_HV = "mem_hv"
-HVST_CPU_TOTAL = "cpu_total"
-HVST_CPU_NODE = "cpu_node"
-
-HVST_DEFAULTS = {
- HVST_MEMORY_TOTAL: 0,
- HVST_MEMORY_NODE: 0,
- HVST_MEMORY_HV: 0,
- HVST_CPU_TOTAL: 1,
- HVST_CPU_NODE: 1,
- }
-
-HVSTS_PARAMETER_TYPES = {
- HVST_MEMORY_TOTAL: VTYPE_INT,
- HVST_MEMORY_NODE: VTYPE_INT,
- HVST_MEMORY_HV: VTYPE_INT,
- HVST_CPU_TOTAL: VTYPE_INT,
- HVST_CPU_NODE: VTYPE_INT,
- }
-
-HVSTS_PARAMETERS = frozenset(HVSTS_PARAMETER_TYPES.keys())
-
-# Disk state
-DS_DISK_TOTAL = "disk_total"
-DS_DISK_RESERVED = "disk_reserved"
-DS_DISK_OVERHEAD = "disk_overhead"
-
-DS_DEFAULTS = {
- DS_DISK_TOTAL: 0,
- DS_DISK_RESERVED: 0,
- DS_DISK_OVERHEAD: 0,
- }
+HVS_PARAMETER_TITLES = _constants.HVS_PARAMETER_TITLES
+
+HV_MIGRATION_COMPLETED = _constants.HV_MIGRATION_COMPLETED
+HV_MIGRATION_ACTIVE = _constants.HV_MIGRATION_ACTIVE
+HV_MIGRATION_FAILED = _constants.HV_MIGRATION_FAILED
+HV_MIGRATION_CANCELLED = _constants.HV_MIGRATION_CANCELLED
+HV_MIGRATION_VALID_STATUSES = _constants.HV_MIGRATION_VALID_STATUSES
+HV_MIGRATION_FAILED_STATUSES = _constants.HV_MIGRATION_FAILED_STATUSES
+HV_KVM_MIGRATION_VALID_STATUSES = _constants.HV_KVM_MIGRATION_VALID_STATUSES
+
+HV_NODEINFO_KEY_VERSION = _constants.HV_NODEINFO_KEY_VERSION
+
+HVST_MEMORY_TOTAL = _constants.HVST_MEMORY_TOTAL
+HVST_MEMORY_NODE = _constants.HVST_MEMORY_NODE
+HVST_MEMORY_HV = _constants.HVST_MEMORY_HV
+HVST_CPU_TOTAL = _constants.HVST_CPU_TOTAL
+HVST_CPU_NODE = _constants.HVST_CPU_NODE
+HVSTS_PARAMETERS = _constants.HVSTS_PARAMETERS
+HVST_DEFAULTS = _constants.HVST_DEFAULTS
+HVSTS_PARAMETER_TYPES = _constants.HVSTS_PARAMETER_TYPES
+
+DS_DISK_TOTAL = _constants.DS_DISK_TOTAL
+DS_DISK_RESERVED = _constants.DS_DISK_RESERVED
+DS_DISK_OVERHEAD = _constants.DS_DISK_OVERHEAD
+DS_DEFAULTS = _constants.DS_DEFAULTS
+DSS_PARAMETER_TYPES = _constants.DSS_PARAMETER_TYPES
+DSS_PARAMETERS = _constants.DSS_PARAMETERS
+DS_VALID_TYPES = _constants.DS_VALID_TYPES
+
+BE_MEMORY = _constants.BE_MEMORY
+BE_MAXMEM = _constants.BE_MAXMEM
+BE_MINMEM = _constants.BE_MINMEM
+BE_VCPUS = _constants.BE_VCPUS
+BE_AUTO_BALANCE = _constants.BE_AUTO_BALANCE
+BE_ALWAYS_FAILOVER = _constants.BE_ALWAYS_FAILOVER
+BE_SPINDLE_USE = _constants.BE_SPINDLE_USE
+BES_PARAMETER_TYPES = _constants.BES_PARAMETER_TYPES
+BES_PARAMETER_TITLES = _constants.BES_PARAMETER_TITLES
+BES_PARAMETER_COMPAT = _constants.BES_PARAMETER_COMPAT
+BES_PARAMETERS = _constants.BES_PARAMETERS
ISPEC_MEM_SIZE = _constants.ISPEC_MEM_SIZE
ISPEC_CPU_COUNT = _constants.ISPEC_CPU_COUNT
NDS_PARAMETER_TYPES = _constants.NDS_PARAMETER_TYPES
NDS_PARAMETERS = _constants.NDS_PARAMETERS
NDS_PARAMETER_TITLES = _constants.NDS_PARAMETER_TITLES
-DSS_PARAMETER_TYPES = {
- DS_DISK_TOTAL: VTYPE_INT,
- DS_DISK_RESERVED: VTYPE_INT,
- DS_DISK_OVERHEAD: VTYPE_INT,
- }
-
-DSS_PARAMETERS = frozenset(DSS_PARAMETER_TYPES.keys())
-DS_VALID_TYPES = compat.UniqueFrozenset([DT_PLAIN])
-
-# Backend parameter names
-BE_MEMORY = "memory" # deprecated and replaced by max and min mem
-BE_MAXMEM = "maxmem"
-BE_MINMEM = "minmem"
-BE_VCPUS = "vcpus"
-BE_AUTO_BALANCE = "auto_balance"
-BE_ALWAYS_FAILOVER = "always_failover"
-BE_SPINDLE_USE = "spindle_use"
-
-BES_PARAMETER_TYPES = {
- BE_MAXMEM: VTYPE_SIZE,
- BE_MINMEM: VTYPE_SIZE,
- BE_VCPUS: VTYPE_INT,
- BE_AUTO_BALANCE: VTYPE_BOOL,
- BE_ALWAYS_FAILOVER: VTYPE_BOOL,
- BE_SPINDLE_USE: VTYPE_INT,
- }
-
-BES_PARAMETER_TITLES = {
- BE_AUTO_BALANCE: "Auto_balance",
- BE_MAXMEM: "ConfigMaxMem",
- BE_MINMEM: "ConfigMinMem",
- BE_VCPUS: "ConfigVCPUs",
- }
-
-BES_PARAMETER_COMPAT = {
- BE_MEMORY: VTYPE_SIZE,
- }
-BES_PARAMETER_COMPAT.update(BES_PARAMETER_TYPES)
-
-BES_PARAMETERS = frozenset(BES_PARAMETER_TYPES.keys())
-
-# Logical Disks parameters
-LDP_RESYNC_RATE = "resync-rate"
-LDP_STRIPES = "stripes"
-LDP_BARRIERS = "disabled-barriers"
-LDP_NO_META_FLUSH = "disable-meta-flush"
-LDP_DEFAULT_METAVG = "default-metavg"
-LDP_DISK_CUSTOM = "disk-custom"
-LDP_NET_CUSTOM = "net-custom"
-LDP_PROTOCOL = "protocol"
-LDP_DYNAMIC_RESYNC = "dynamic-resync"
-LDP_PLAN_AHEAD = "c-plan-ahead"
-LDP_FILL_TARGET = "c-fill-target"
-LDP_DELAY_TARGET = "c-delay-target"
-LDP_MAX_RATE = "c-max-rate"
-LDP_MIN_RATE = "c-min-rate"
-LDP_POOL = "pool"
-LDP_ACCESS = "access"
-DISK_LD_TYPES = {
- LDP_RESYNC_RATE: VTYPE_INT,
- LDP_STRIPES: VTYPE_INT,
- LDP_BARRIERS: VTYPE_STRING,
- LDP_NO_META_FLUSH: VTYPE_BOOL,
- LDP_DEFAULT_METAVG: VTYPE_STRING,
- LDP_DISK_CUSTOM: VTYPE_STRING,
- LDP_NET_CUSTOM: VTYPE_STRING,
- LDP_PROTOCOL: VTYPE_STRING,
- LDP_DYNAMIC_RESYNC: VTYPE_BOOL,
- LDP_PLAN_AHEAD: VTYPE_INT,
- LDP_FILL_TARGET: VTYPE_INT,
- LDP_DELAY_TARGET: VTYPE_INT,
- LDP_MAX_RATE: VTYPE_INT,
- LDP_MIN_RATE: VTYPE_INT,
- LDP_POOL: VTYPE_STRING,
- LDP_ACCESS: VTYPE_STRING,
- }
-DISK_LD_PARAMETERS = frozenset(DISK_LD_TYPES.keys())
-
-# Disk template parameters (can be set/changed by the user via gnt-cluster and
-# gnt-group)
-DRBD_RESYNC_RATE = "resync-rate"
-DRBD_DATA_STRIPES = "data-stripes"
-DRBD_META_STRIPES = "meta-stripes"
-DRBD_DISK_BARRIERS = "disk-barriers"
-DRBD_META_BARRIERS = "meta-barriers"
-DRBD_DEFAULT_METAVG = "metavg"
-DRBD_DISK_CUSTOM = "disk-custom"
-DRBD_NET_CUSTOM = "net-custom"
-DRBD_PROTOCOL = "protocol"
-DRBD_DYNAMIC_RESYNC = "dynamic-resync"
-DRBD_PLAN_AHEAD = "c-plan-ahead"
-DRBD_FILL_TARGET = "c-fill-target"
-DRBD_DELAY_TARGET = "c-delay-target"
-DRBD_MAX_RATE = "c-max-rate"
-DRBD_MIN_RATE = "c-min-rate"
-LV_STRIPES = "stripes"
-RBD_POOL = "pool"
-RBD_ACCESS = "access"
-DISK_DT_TYPES = {
- DRBD_RESYNC_RATE: VTYPE_INT,
- DRBD_DATA_STRIPES: VTYPE_INT,
- DRBD_META_STRIPES: VTYPE_INT,
- DRBD_DISK_BARRIERS: VTYPE_STRING,
- DRBD_META_BARRIERS: VTYPE_BOOL,
- DRBD_DEFAULT_METAVG: VTYPE_STRING,
- DRBD_DISK_CUSTOM: VTYPE_STRING,
- DRBD_NET_CUSTOM: VTYPE_STRING,
- DRBD_PROTOCOL: VTYPE_STRING,
- DRBD_DYNAMIC_RESYNC: VTYPE_BOOL,
- DRBD_PLAN_AHEAD: VTYPE_INT,
- DRBD_FILL_TARGET: VTYPE_INT,
- DRBD_DELAY_TARGET: VTYPE_INT,
- DRBD_MAX_RATE: VTYPE_INT,
- DRBD_MIN_RATE: VTYPE_INT,
- LV_STRIPES: VTYPE_INT,
- RBD_POOL: VTYPE_STRING,
- RBD_ACCESS: VTYPE_STRING,
- }
-DISK_DT_PARAMETERS = frozenset(DISK_DT_TYPES.keys())
-
-# dynamic disk parameters
-DDP_LOCAL_IP = "local-ip"
-DDP_REMOTE_IP = "remote-ip"
-DDP_PORT = "port"
-DDP_LOCAL_MINOR = "local-minor"
-DDP_REMOTE_MINOR = "remote-minor"
+LDP_RESYNC_RATE = _constants.LDP_RESYNC_RATE
+LDP_STRIPES = _constants.LDP_STRIPES
+LDP_BARRIERS = _constants.LDP_BARRIERS
+LDP_NO_META_FLUSH = _constants.LDP_NO_META_FLUSH
+LDP_DEFAULT_METAVG = _constants.LDP_DEFAULT_METAVG
+LDP_DISK_CUSTOM = _constants.LDP_DISK_CUSTOM
+LDP_NET_CUSTOM = _constants.LDP_NET_CUSTOM
+LDP_PROTOCOL = _constants.LDP_PROTOCOL
+LDP_DYNAMIC_RESYNC = _constants.LDP_DYNAMIC_RESYNC
+LDP_PLAN_AHEAD = _constants.LDP_PLAN_AHEAD
+LDP_FILL_TARGET = _constants.LDP_FILL_TARGET
+LDP_DELAY_TARGET = _constants.LDP_DELAY_TARGET
+LDP_MAX_RATE = _constants.LDP_MAX_RATE
+LDP_MIN_RATE = _constants.LDP_MIN_RATE
+LDP_POOL = _constants.LDP_POOL
+LDP_ACCESS = _constants.LDP_ACCESS
+DISK_LD_TYPES = _constants.DISK_LD_TYPES
+DISK_LD_PARAMETERS = _constants.DISK_LD_PARAMETERS
+
+DRBD_RESYNC_RATE = _constants.DRBD_RESYNC_RATE
+DRBD_DATA_STRIPES = _constants.DRBD_DATA_STRIPES
+DRBD_META_STRIPES = _constants.DRBD_META_STRIPES
+DRBD_DISK_BARRIERS = _constants.DRBD_DISK_BARRIERS
+DRBD_META_BARRIERS = _constants.DRBD_META_BARRIERS
+DRBD_DEFAULT_METAVG = _constants.DRBD_DEFAULT_METAVG
+DRBD_DISK_CUSTOM = _constants.DRBD_DISK_CUSTOM
+DRBD_NET_CUSTOM = _constants.DRBD_NET_CUSTOM
+DRBD_PROTOCOL = _constants.DRBD_PROTOCOL
+DRBD_DYNAMIC_RESYNC = _constants.DRBD_DYNAMIC_RESYNC
+DRBD_PLAN_AHEAD = _constants.DRBD_PLAN_AHEAD
+DRBD_FILL_TARGET = _constants.DRBD_FILL_TARGET
+DRBD_DELAY_TARGET = _constants.DRBD_DELAY_TARGET
+DRBD_MAX_RATE = _constants.DRBD_MAX_RATE
+DRBD_MIN_RATE = _constants.DRBD_MIN_RATE
+LV_STRIPES = _constants.LV_STRIPES
+RBD_ACCESS = _constants.RBD_ACCESS
+RBD_POOL = _constants.RBD_POOL
+DISK_DT_TYPES = _constants.DISK_DT_TYPES
+DISK_DT_PARAMETERS = _constants.DISK_DT_PARAMETERS
+
+DDP_LOCAL_IP = _constants.DDP_LOCAL_IP
+DDP_REMOTE_IP = _constants.DDP_REMOTE_IP
+DDP_PORT = _constants.DDP_PORT
+DDP_LOCAL_MINOR = _constants.DDP_LOCAL_MINOR
+DDP_REMOTE_MINOR = _constants.DDP_REMOTE_MINOR
# OOB supported commands
OOB_POWER_ON = _constants.OOB_POWER_ON
OOB_STATUS_UNKNOWN = _constants.OOB_STATUS_UNKNOWN
OOB_STATUSES = _constants.OOB_STATUSES
-# Instance Parameters Profile
-PP_DEFAULT = "default"
+PP_DEFAULT = _constants.PP_DEFAULT
-# NIC_* constants are used inside the ganeti config
NIC_MODE = _constants.NIC_MODE
NIC_LINK = _constants.NIC_LINK
NIC_VLAN = _constants.NIC_VLAN
+NICS_PARAMETER_TYPES = _constants.NICS_PARAMETER_TYPES
+NICS_PARAMETERS = _constants.NICS_PARAMETERS
NIC_MODE_BRIDGED = _constants.NIC_MODE_BRIDGED
NIC_MODE_ROUTED = _constants.NIC_MODE_ROUTED
NIC_IP_POOL = _constants.NIC_IP_POOL
NIC_VALID_MODES = _constants.NIC_VALID_MODES
-RESERVE_ACTION = "reserve"
-RELEASE_ACTION = "release"
-
-NICS_PARAMETER_TYPES = {
- NIC_MODE: VTYPE_STRING,
- NIC_LINK: VTYPE_STRING,
- NIC_VLAN: VTYPE_MAYBE_STRING,
- }
-
-NICS_PARAMETERS = frozenset(NICS_PARAMETER_TYPES.keys())
-
-# IDISK_* constants are used in opcodes, to create/change disks
-IDISK_SIZE = "size"
-IDISK_SPINDLES = "spindles"
-IDISK_MODE = "mode"
-IDISK_ADOPT = "adopt"
-IDISK_VG = "vg"
-IDISK_METAVG = "metavg"
-IDISK_PROVIDER = "provider"
-IDISK_NAME = "name"
-IDISK_PARAMS_TYPES = {
- IDISK_SIZE: VTYPE_SIZE,
- IDISK_SPINDLES: VTYPE_INT,
- IDISK_MODE: VTYPE_STRING,
- IDISK_ADOPT: VTYPE_STRING,
- IDISK_VG: VTYPE_STRING,
- IDISK_METAVG: VTYPE_STRING,
- IDISK_PROVIDER: VTYPE_STRING,
- IDISK_NAME: VTYPE_MAYBE_STRING,
- }
-IDISK_PARAMS = frozenset(IDISK_PARAMS_TYPES.keys())
-
-# INIC_* constants are used in opcodes, to create/change nics
-INIC_MAC = "mac"
-INIC_IP = "ip"
-INIC_MODE = "mode"
-INIC_LINK = "link"
-INIC_NETWORK = "network"
-INIC_NAME = "name"
-INIC_VLAN = "vlan"
-INIC_BRIDGE = "bridge"
-INIC_PARAMS_TYPES = {
- INIC_IP: VTYPE_MAYBE_STRING,
- INIC_LINK: VTYPE_STRING,
- INIC_MAC: VTYPE_STRING,
- INIC_MODE: VTYPE_STRING,
- INIC_NETWORK: VTYPE_MAYBE_STRING,
- INIC_NAME: VTYPE_MAYBE_STRING,
- INIC_VLAN: VTYPE_MAYBE_STRING,
- INIC_BRIDGE: VTYPE_MAYBE_STRING
- }
-INIC_PARAMS = frozenset(INIC_PARAMS_TYPES.keys())
+RESERVE_ACTION = _constants.RESERVE_ACTION
+RELEASE_ACTION = _constants.RELEASE_ACTION
+
+IDISK_SIZE = _constants.IDISK_SIZE
+IDISK_SPINDLES = _constants.IDISK_SPINDLES
+IDISK_MODE = _constants.IDISK_MODE
+IDISK_ADOPT = _constants.IDISK_ADOPT
+IDISK_VG = _constants.IDISK_VG
+IDISK_METAVG = _constants.IDISK_METAVG
+IDISK_PROVIDER = _constants.IDISK_PROVIDER
+IDISK_NAME = _constants.IDISK_NAME
+IDISK_PARAMS_TYPES = _constants.IDISK_PARAMS_TYPES
+IDISK_PARAMS = _constants.IDISK_PARAMS
+
+INIC_MAC = _constants.INIC_MAC
+INIC_IP = _constants.INIC_IP
+INIC_MODE = _constants.INIC_MODE
+INIC_LINK = _constants.INIC_LINK
+INIC_NETWORK = _constants.INIC_NETWORK
+INIC_NAME = _constants.INIC_NAME
+INIC_VLAN = _constants.INIC_VLAN
+INIC_BRIDGE = _constants.INIC_BRIDGE
+INIC_PARAMS_TYPES = _constants.INIC_PARAMS_TYPES
+INIC_PARAMS = _constants.INIC_PARAMS
# Hypervisor constants
HT_XEN_PVM = _constants.HT_XEN_PVM
HYPER_TYPES = _constants.HYPER_TYPES
HTS_REQ_PORT = _constants.HTS_REQ_PORT
-VNC_BASE_PORT = 5900
-VNC_DEFAULT_BIND_ADDRESS = IP4_ADDRESS_ANY
-
+VNC_BASE_PORT = _constants.VNC_BASE_PORT
+VNC_DEFAULT_BIND_ADDRESS = _constants.VNC_DEFAULT_BIND_ADDRESS
# NIC types
HT_NIC_RTL8139 = "rtl8139"
HT_NIC_NE2K_PCI = "ne2k_pci"
CV_ALL_ECODES = _constants.CV_ALL_ECODES
CV_ALL_ECODES_STRINGS = _constants.CV_ALL_ECODES_STRINGS
-# Node verify constants
-NV_BRIDGES = "bridges"
-NV_DRBDHELPER = "drbd-helper"
-NV_DRBDVERSION = "drbd-version"
-NV_DRBDLIST = "drbd-list"
-NV_EXCLUSIVEPVS = "exclusive-pvs"
-NV_FILELIST = "filelist"
-NV_ACCEPTED_STORAGE_PATHS = "allowed-file-storage-paths"
-NV_FILE_STORAGE_PATH = "file-storage-path"
-NV_SHARED_FILE_STORAGE_PATH = "shared-file-storage-path"
-NV_HVINFO = "hvinfo"
-NV_HVPARAMS = "hvparms"
-NV_HYPERVISOR = "hypervisor"
-NV_INSTANCELIST = "instancelist"
-NV_LVLIST = "lvlist"
-NV_MASTERIP = "master-ip"
-NV_NODELIST = "nodelist"
-NV_NODENETTEST = "node-net-test"
-NV_NODESETUP = "nodesetup"
-NV_OOB_PATHS = "oob-paths"
-NV_OSLIST = "oslist"
-NV_PVLIST = "pvlist"
-NV_TIME = "time"
-NV_USERSCRIPTS = "user-scripts"
-NV_VERSION = "version"
-NV_VGLIST = "vglist"
-NV_VMNODES = "vmnodes"
-
-# Instance status
+NV_BRIDGES = _constants.NV_BRIDGES
+NV_DRBDHELPER = _constants.NV_DRBDHELPER
+NV_DRBDVERSION = _constants.NV_DRBDVERSION
+NV_DRBDLIST = _constants.NV_DRBDLIST
+NV_EXCLUSIVEPVS = _constants.NV_EXCLUSIVEPVS
+NV_FILELIST = _constants.NV_FILELIST
+NV_ACCEPTED_STORAGE_PATHS = _constants.NV_ACCEPTED_STORAGE_PATHS
+NV_FILE_STORAGE_PATH = _constants.NV_FILE_STORAGE_PATH
+NV_SHARED_FILE_STORAGE_PATH = _constants.NV_SHARED_FILE_STORAGE_PATH
+NV_HVINFO = _constants.NV_HVINFO
+NV_HVPARAMS = _constants.NV_HVPARAMS
+NV_HYPERVISOR = _constants.NV_HYPERVISOR
+NV_INSTANCELIST = _constants.NV_INSTANCELIST
+NV_LVLIST = _constants.NV_LVLIST
+NV_MASTERIP = _constants.NV_MASTERIP
+NV_NODELIST = _constants.NV_NODELIST
+NV_NODENETTEST = _constants.NV_NODENETTEST
+NV_NODESETUP = _constants.NV_NODESETUP
+NV_OOB_PATHS = _constants.NV_OOB_PATHS
+NV_OSLIST = _constants.NV_OSLIST
+NV_PVLIST = _constants.NV_PVLIST
+NV_TIME = _constants.NV_TIME
+NV_USERSCRIPTS = _constants.NV_USERSCRIPTS
+NV_VERSION = _constants.NV_VERSION
+NV_VGLIST = _constants.NV_VGLIST
+NV_VMNODES = _constants.NV_VMNODES
+
INSTST_RUNNING = _constants.INSTST_RUNNING
INSTST_ADMINDOWN = _constants.INSTST_ADMINDOWN
INSTST_ADMINOFFLINE = _constants.INSTST_ADMINOFFLINE
NR_OFFLINE = _constants.NR_OFFLINE
NR_ALL = _constants.NR_ALL
-# SSL certificate check constants (in days)
-SSL_CERT_EXPIRATION_WARN = 30
-SSL_CERT_EXPIRATION_ERROR = 7
+SSL_CERT_EXPIRATION_WARN = _constants.SSL_CERT_EXPIRATION_WARN
+SSL_CERT_EXPIRATION_ERROR = _constants.SSL_CERT_EXPIRATION_ERROR
# Allocator framework constants
IALLOCATOR_VERSION = _constants.IALLOCATOR_VERSION
NODE_EVAC_ALL = _constants.NODE_EVAC_ALL
NODE_EVAC_MODES = _constants.NODE_EVAC_MODES
-# Job queue
-JOB_QUEUE_VERSION = 1
-JOB_QUEUE_SIZE_HARD_LIMIT = 5000
-JOB_QUEUE_FILES_PERMS = 0640
+JOB_QUEUE_VERSION = _constants.JOB_QUEUE_VERSION
+JOB_QUEUE_SIZE_HARD_LIMIT = _constants.JOB_QUEUE_SIZE_HARD_LIMIT
+JOB_QUEUE_FILES_PERMS = _constants.JOB_QUEUE_FILES_PERMS
JOB_ID_TEMPLATE = r"\d+"
JOB_FILE_RE = re.compile(r"^job-(%s)$" % JOB_ID_TEMPLATE)
-# unchanged job return
-JOB_NOTCHANGED = "nochange"
+JOB_NOTCHANGED = _constants.JOB_NOTCHANGED
# Job status
JOB_STATUS_QUEUED = _constants.JOB_STATUS_QUEUED
OP_PRIO_SUBMIT_VALID = _constants.OP_PRIO_SUBMIT_VALID
OP_PRIO_DEFAULT = _constants.OP_PRIO_DEFAULT
-# Lock recalculate mode
-LOCKS_REPLACE = "replace"
-LOCKS_APPEND = "append"
-
-# Lock timeout (sum) before we should go into blocking acquire (still
-# can be reset by priority change); computed as max time (10 hours)
-# before we should actually go into blocking acquire given that we
-# start from default priority level; in seconds
-# TODO
-LOCK_ATTEMPTS_TIMEOUT = 10 * 3600 / (OP_PRIO_DEFAULT - OP_PRIO_HIGHEST)
-LOCK_ATTEMPTS_MAXWAIT = 15.0
-LOCK_ATTEMPTS_MINWAIT = 1.0
+LOCKS_REPLACE = _constants.LOCKS_REPLACE
+LOCKS_APPEND = _constants.LOCKS_APPEND
+
+LOCK_ATTEMPTS_TIMEOUT = _constants.LOCK_ATTEMPTS_TIMEOUT
+LOCK_ATTEMPTS_MAXWAIT = _constants.LOCK_ATTEMPTS_MAXWAIT
+LOCK_ATTEMPTS_MINWAIT = _constants.LOCK_ATTEMPTS_MINWAIT
# Execution log types
ELOG_MESSAGE = _constants.ELOG_MESSAGE