Revision e0007cf1

b/lib/constants.py
128 128
EXTRA_LOGREASON_ACCESS = "access"
129 129
EXTRA_LOGREASON_ERROR = "error"
130 130

  
131
# These are the extra logfiles, grouped by daemon
132
DAEMONS_EXTRA_LOGBASE = {
133
  MOND: {
134
    EXTRA_LOGREASON_ACCESS: _constants.EXTRA_LOGREASON_ACCESS,
135
    EXTRA_LOGREASON_ERROR: _constants.EXTRA_LOGREASON_ERROR,
136
    }
137
  }
131
DAEMONS_EXTRA_LOGBASE = _constants.DAEMONS_EXTRA_LOGBASE
138 132

  
139 133
DAEMONS_EXTRA_LOGFILES = \
140 134
  dict((daemon, dict((extra,
b/src/Ganeti/HsConstants.hs
384 384
  Map.fromList
385 385
  [ (Runtime.daemonName d, Runtime.daemonLogBase d) | d <- [minBound..] ]
386 386

  
387
daemonsExtraLogbase :: Map String (Map String String)
388
daemonsExtraLogbase =
389
  Map.fromList $
390
  map (Runtime.daemonName *** id)
391
  [ (GanetiMond, Map.fromList
392
                 [ ("access", Runtime.daemonsExtraLogbase GanetiMond AccessLog)
393
                 , ("error", Runtime.daemonsExtraLogbase GanetiMond ErrorLog)
394
                 ])
395
  ]
396

  
387 397
extraLogreasonAccess :: String
388 398
extraLogreasonAccess = Runtime.daemonsExtraLogbase GanetiMond AccessLog
389 399

  
b/test/py/ganeti.constants_unittest.py
101 101
    self.assertTrue(constants.DEFAULT_ENABLED_HYPERVISOR in
102 102
                    constants.HYPER_TYPES)
103 103

  
104
  def testExtraLogfiles(self):
105
    for daemon in constants.DAEMONS_EXTRA_LOGBASE:
106
      self.assertTrue(daemon in constants.DAEMONS)
107
      for log_reason in constants.DAEMONS_EXTRA_LOGBASE[daemon]:
108
        self.assertTrue(log_reason in constants.VALID_EXTRA_LOGREASONS)
109

  
110 104

  
111 105
class TestExportedNames(unittest.TestCase):
112 106
  _VALID_NAME_RE = re.compile(r"^[A-Z][A-Z0-9_]+$")

Also available in: Unified diff