Revision 5d4e1402

b/lib/constants.py
169 169

  
170 170
PROC_MOUNTS = "/proc/mounts"
171 171

  
172
# Local UniX Interface related constants
173
LUXI_EOM = chr(3)
174
LUXI_VERSION = CONFIG_VERSION
175
#: Environment variable for the luxi override socket
176
LUXI_OVERRIDE = "FORCE_LUXI_SOCKET"
177
LUXI_OVERRIDE_MASTER = "master"
178
LUXI_OVERRIDE_QUERY = "query"
179

  
172
LUXI_EOM = _constants.LUXI_EOM
173
LUXI_VERSION = _constants.LUXI_VERSION
174
LUXI_OVERRIDE = _constants.LUXI_OVERRIDE
175
LUXI_OVERRIDE_MASTER = _constants.LUXI_OVERRIDE_MASTER
176
LUXI_OVERRIDE_QUERY = _constants.LUXI_OVERRIDE_QUERY
180 177
# one of "no", "yes", "only"
181 178
SYSLOG_USAGE = _constants.SYSLOG_USAGE
182 179
SYSLOG_NO = _constants.SYSLOG_NO
b/src/Ganeti/ConstantUtils.hs
28 28
-}
29 29
module Ganeti.ConstantUtils where
30 30

  
31
import Data.Char (ord)
31 32
import Data.Set (Set)
32 33
import qualified Data.Set as Set (fromList, toList)
33 34

  
34 35
import Ganeti.THH (PyValue(..))
35 36
import Ganeti.PyValueInstances ()
36 37

  
38
-- | PythonChar wraps a Python 'char'
39
newtype PythonChar = PythonChar { unPythonChar :: Char }
40
  deriving (Show)
41

  
42
instance PyValue PythonChar where
43
  showValue c = "chr(" ++ show (ord (unPythonChar c)) ++ ")"
44

  
37 45
-- | FrozenSet wraps a Haskell 'Set'
38 46
--
39 47
-- See 'PyValue' instance for 'FrozenSet'.
b/src/Ganeti/HsConstants.hs
41 41
import qualified Data.Map as Map (fromList, keys, insert)
42 42

  
43 43
import AutoConf
44
import Ganeti.ConstantUtils (FrozenSet, Protocol(..), buildVersion)
44
import Ganeti.ConstantUtils (PythonChar(..), FrozenSet, Protocol(..),
45
                             buildVersion)
45 46
import qualified Ganeti.ConstantUtils as ConstantUtils
46 47
import Ganeti.Runtime (GanetiDaemon(..), MiscGroup(..), GanetiGroup(..),
47 48
                       ExtraLogReason(..))
......
341 342
devConsole :: String
342 343
devConsole = ConstantUtils.devConsole
343 344

  
345
-- * Luxi (Local UniX Interface) related constants
346

  
347
luxiEom :: PythonChar
348
luxiEom = PythonChar '\x03'
349

  
350
-- | Environment variable for the luxi override socket
351
luxiOverride :: String
352
luxiOverride = "FORCE_LUXI_SOCKET"
353

  
354
luxiOverrideMaster :: String
355
luxiOverrideMaster = "master"
356

  
357
luxiOverrideQuery :: String
358
luxiOverrideQuery = "query"
359

  
360
luxiVersion :: Int
361
luxiVersion = configVersion
362

  
344 363
-- * Syslog
345 364

  
346 365
syslogUsage :: String

Also available in: Unified diff