From 1db32048860167da0078033671c3fe6fb7679b04 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Mon, 10 Dec 2012 11:06:21 +0100 Subject: [PATCH] Export more paths from Path.hs Also adds a small helper for building the paths. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michele Tartara <mtartara@google.com> --- htools/Ganeti/Path.hs | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/htools/Ganeti/Path.hs b/htools/Ganeti/Path.hs index 277fe0bad..9383c1886 100644 --- a/htools/Ganeti/Path.hs +++ b/htools/Ganeti/Path.hs @@ -33,6 +33,9 @@ module Ganeti.Path , confdHmacKey , clusterConfFile , nodedCertFile + , queueDir + , jobQueueSerialFile + , jobQueueArchiveSubDir ) where import System.FilePath @@ -61,6 +64,10 @@ addNodePrefix path = do dataDir :: IO FilePath dataDir = addNodePrefix $ C.autoconfLocalstatedir </> "lib" </> "ganeti" +-- | Helper for building on top of dataDir (internal). +dataDirP :: FilePath -> IO FilePath +dataDirP = (dataDir `pjoin`) + -- | Directory for runtime files. runDir :: IO FilePath runDir = addNodePrefix $ C.autoconfLocalstatedir </> "run" </> "ganeti" @@ -83,12 +90,24 @@ defaultQuerySocket = socketDir `pjoin` "ganeti-query" -- | Path to file containing confd's HMAC key. confdHmacKey :: IO FilePath -confdHmacKey = dataDir `pjoin` "hmac.key" +confdHmacKey = dataDirP "hmac.key" -- | Path to cluster configuration file. clusterConfFile :: IO FilePath -clusterConfFile = dataDir `pjoin` "config.data" +clusterConfFile = dataDirP "config.data" -- | Path to the noded certificate. -nodedCertFile :: IO FilePath -nodedCertFile = dataDir `pjoin` "server.pem" +nodedCertFile :: IO FilePath +nodedCertFile = dataDirP "server.pem" + +-- | Job queue directory. +queueDir :: IO FilePath +queueDir = dataDirP "queue" + +-- | Job queue serial file. +jobQueueSerialFile :: IO FilePath +jobQueueSerialFile = dataDirP "serial" + +-- | Job queue archive directory. +jobQueueArchiveSubDir :: FilePath +jobQueueArchiveSubDir = "archive" -- GitLab