projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Avoid absolute path for privileged commands
[ganeti-local]
/
lib
/
constants.py
diff --git
a/lib/constants.py
b/lib/constants.py
index
e8f8ae7
..
27ca325
100644
(file)
--- a/
lib/constants.py
+++ b/
lib/constants.py
@@
-21,10
+21,12
@@
"""Module holding different constants."""
"""Module holding different constants."""
+import re
+
from ganeti import _autoconf
# various versions
from ganeti import _autoconf
# various versions
-PROTOCOL_VERSION = 20
+PROTOCOL_VERSION = 30
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
OS_API_V10 = 10
OS_API_V15 = 15
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
OS_API_V10 = 10
OS_API_V15 = 15
@@
-117,6
+119,8
@@
NODED = "ganeti-noded"
CONFD = "ganeti-confd"
RAPI = "ganeti-rapi"
MASTERD = "ganeti-masterd"
CONFD = "ganeti-confd"
RAPI = "ganeti-rapi"
MASTERD = "ganeti-masterd"
+# used in the ganeti-nbma project
+NLD = "ganeti-nld"
MULTITHREADED_DAEMONS = frozenset([MASTERD])
MULTITHREADED_DAEMONS = frozenset([MASTERD])
@@
-131,10
+135,14
@@
DAEMONS_PORTS = {
NODED: ("tcp", 1811),
CONFD: ("udp", 1814),
RAPI: ("tcp", 5080),
NODED: ("tcp", 1811),
CONFD: ("udp", 1814),
RAPI: ("tcp", 5080),
+ # used in the ganeti-nbma project
+ NLD: ("udp", 1816),
}
DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
}
DEFAULT_NODED_PORT = DAEMONS_PORTS[NODED][1]
DEFAULT_CONFD_PORT = DAEMONS_PORTS[CONFD][1]
DEFAULT_RAPI_PORT = DAEMONS_PORTS[RAPI][1]
+# used in the ganeti-nbma project
+DEFAULT_NLD_PORT = DAEMONS_PORTS[NLD][1]
FIRST_DRBD_PORT = 11000
LAST_DRBD_PORT = 14999
FIRST_DRBD_PORT = 11000
LAST_DRBD_PORT = 14999
@@
-147,12
+155,21
@@
DAEMONS_LOGFILES = {
CONFD: LOG_DIR + "conf-daemon.log",
RAPI: LOG_DIR + "rapi-daemon.log",
MASTERD: LOG_DIR + "master-daemon.log",
CONFD: LOG_DIR + "conf-daemon.log",
RAPI: LOG_DIR + "rapi-daemon.log",
MASTERD: LOG_DIR + "master-daemon.log",
+ # used in the ganeti-nbma project
+ NLD: LOG_DIR + "nl-daemon.log",
}
LOG_OS_DIR = LOG_DIR + "os"
LOG_WATCHER = LOG_DIR + "watcher.log"
LOG_COMMANDS = LOG_DIR + "commands.log"
LOG_BURNIN = LOG_DIR + "burnin.log"
}
LOG_OS_DIR = LOG_DIR + "os"
LOG_WATCHER = LOG_DIR + "watcher.log"
LOG_COMMANDS = LOG_DIR + "commands.log"
LOG_BURNIN = LOG_DIR + "burnin.log"
+# one of 'no', 'yes', 'only'
+SYSLOG_USAGE = _autoconf.SYSLOG_USAGE
+SYSLOG_NO = "no"
+SYSLOG_YES = "yes"
+SYSLOG_ONLY = "only"
+SYSLOG_SOCKET = "/dev/log"
+
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH
EXPORT_DIR = _autoconf.EXPORT_DIR
OS_SEARCH_PATH = _autoconf.OS_SEARCH_PATH
EXPORT_DIR = _autoconf.EXPORT_DIR
@@
-174,11
+191,15
@@
VALUE_NONE = "none"
VALUE_TRUE = "true"
VALUE_FALSE = "false"
VALUE_TRUE = "true"
VALUE_FALSE = "false"
+# External script validation mask
+EXT_PLUGIN_MASK = re.compile("^[a-zA-Z0-9_-]+$")
+
# hooks-related constants
HOOKS_BASE_DIR = CONF_DIR + "/hooks"
HOOKS_PHASE_PRE = "pre"
HOOKS_PHASE_POST = "post"
HOOKS_NAME_CFGUPDATE = "config-update"
# hooks-related constants
HOOKS_BASE_DIR = CONF_DIR + "/hooks"
HOOKS_PHASE_PRE = "pre"
HOOKS_PHASE_POST = "post"
HOOKS_NAME_CFGUPDATE = "config-update"
+HOOKS_NAME_WATCHER = "watcher"
HOOKS_VERSION = 2
# hooks subject type (what object type does the LU deal with)
HOOKS_VERSION = 2
# hooks subject type (what object type does the LU deal with)
@@
-250,6
+271,7
@@
LDS_BLOCK = frozenset([LD_LV, LD_DRBD8])
# drbd constants
DRBD_HMAC_ALG = "md5"
DRBD_NET_PROTOCOL = "C"
# drbd constants
DRBD_HMAC_ALG = "md5"
DRBD_NET_PROTOCOL = "C"
+DRBD_BARRIERS = _autoconf.DRBD_BARRIERS
# file backend driver
FD_LOOP = "loop"
# file backend driver
FD_LOOP = "loop"
@@
-322,6
+344,13
@@
LVM_STRIPECOUNT = _autoconf.LVM_STRIPECOUNT
DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
DEFAULT_SHUTDOWN_TIMEOUT = 120
NODE_MAX_CLOCK_SKEW = 150
+# runparts results
+(RUNPARTS_SKIP,
+ RUNPARTS_RUN,
+ RUNPARTS_ERR) = range(3)
+
+RUNPARTS_STATUS = frozenset([RUNPARTS_SKIP, RUNPARTS_RUN, RUNPARTS_ERR])
+
# RPC constants
(RPC_ENCODING_NONE,
RPC_ENCODING_ZLIB_BASE64) = range(2)
# RPC constants
(RPC_ENCODING_NONE,
RPC_ENCODING_ZLIB_BASE64) = range(2)
@@
-338,10
+367,10
@@
OS_API_FILE = 'ganeti_api_version'
OS_VARIANTS_FILE = 'variants.list'
# ssh constants
OS_VARIANTS_FILE = 'variants.list'
# ssh constants
-SSH_CONFIG_DIR = "/etc/ssh/"
-SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "ssh_host_dsa_key"
+SSH_CONFIG_DIR = _autoconf.SSH_CONFIG_DIR
+SSH_HOST_DSA_PRIV = SSH_CONFIG_DIR + "/ssh_host_dsa_key"
SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
SSH_HOST_DSA_PUB = SSH_HOST_DSA_PRIV + ".pub"
-SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "ssh_host_rsa_key"
+SSH_HOST_RSA_PRIV = SSH_CONFIG_DIR + "/ssh_host_rsa_key"
SSH_HOST_RSA_PUB = SSH_HOST_RSA_PRIV + ".pub"
SSH = "ssh"
SCP = "scp"
SSH_HOST_RSA_PUB = SSH_HOST_RSA_PRIV + ".pub"
SSH = "ssh"
SCP = "scp"
@@
-545,6
+574,7
@@
IALLOCATOR_DIR_IN = "in"
IALLOCATOR_DIR_OUT = "out"
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
IALLOCATOR_DIR_OUT = "out"
IALLOCATOR_MODE_ALLOC = "allocate"
IALLOCATOR_MODE_RELOC = "relocate"
+IALLOCATOR_MODE_MEVAC = "multi-evacuate"
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
# Job queue
IALLOCATOR_SEARCH_PATH = _autoconf.IALLOCATOR_SEARCH_PATH
# Job queue