Revision a8828704
b/lib/constants.py | ||
---|---|---|
158 | 158 |
RAPI = "ganeti-rapi" |
159 | 159 |
MASTERD = "ganeti-masterd" |
160 | 160 |
|
161 |
DAEMONS = compat.UniqueFrozenset([ |
|
162 |
NODED, |
|
163 |
CONFD, |
|
164 |
RAPI, |
|
165 |
MASTERD, |
|
166 |
]) |
|
167 |
|
|
161 | 168 |
DAEMONS_PORTS = { |
162 | 169 |
# daemon-name: ("proto", "default-port") |
163 | 170 |
NODED: ("tcp", 1811), |
... | ... | |
183 | 190 |
dict((daemon, pathutils.GetLogFilename(DAEMONS_LOGBASE[daemon])) |
184 | 191 |
for daemon in DAEMONS_LOGBASE) |
185 | 192 |
|
193 |
# Some daemons might require more than one logfile. |
|
194 |
|
|
195 |
# These are the only valid reasons for having an extra logfile |
|
196 |
EXTRA_LOGREASON_ACCESS = "access" |
|
197 |
EXTRA_LOGREASON_ERROR = "error" |
|
198 |
|
|
199 |
VALID_EXTRA_LOGREASONS = compat.UniqueFrozenset([ |
|
200 |
EXTRA_LOGREASON_ACCESS, |
|
201 |
EXTRA_LOGREASON_ERROR, |
|
202 |
]) |
|
203 |
|
|
204 |
# These are the extra logfiles, grouped by daemon |
|
205 |
DAEMONS_EXTRA_LOGBASE = {} |
|
206 |
|
|
207 |
DAEMONS_EXTRA_LOGFILES = \ |
|
208 |
dict((daemon, dict((extra, |
|
209 |
pathutils.GetLogFilename(DAEMONS_EXTRA_LOGBASE[daemon][extra])) |
|
210 |
for extra in DAEMONS_EXTRA_LOGBASE[daemon])) |
|
211 |
for daemon in DAEMONS_EXTRA_LOGBASE) |
|
212 |
|
|
186 | 213 |
DEV_CONSOLE = "/dev/console" |
187 | 214 |
|
188 | 215 |
PROC_MOUNTS = "/proc/mounts" |
b/test/py/ganeti.constants_unittest.py | ||
---|---|---|
98 | 98 |
self.assertTrue(constants.DEFAULT_ENABLED_HYPERVISOR in |
99 | 99 |
constants.HYPER_TYPES) |
100 | 100 |
|
101 |
def testExtraLogfiles(self): |
|
102 |
for daemon in constants.DAEMONS_EXTRA_LOGBASE: |
|
103 |
self.assertTrue(daemon in constants.DAEMONS) |
|
104 |
for log_reason in constants.DAEMONS_EXTRA_LOGBASE[daemon]: |
|
105 |
self.assertTrue(log_reason in constants.VALID_EXTRA_LOGREASONS) |
|
106 |
|
|
101 | 107 |
|
102 | 108 |
class TestExportedNames(unittest.TestCase): |
103 | 109 |
_VALID_NAME_RE = re.compile(r"^[A-Z][A-Z0-9_]+$") |
Also available in: Unified diff