.. where we have all the socket names for our daemons.

Signed-off-by: Petr Pudlak <[email protected]>
---
 src/Ganeti/Metad/ConfigServer.hs | 11 +++--------
 src/Ganeti/Path.hs               |  5 +++++
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/Ganeti/Metad/ConfigServer.hs b/src/Ganeti/Metad/ConfigServer.hs
index 55c5b99..c202cd6 100644
--- a/src/Ganeti/Metad/ConfigServer.hs
+++ b/src/Ganeti/Metad/ConfigServer.hs
@@ -38,7 +38,6 @@ import Control.Concurrent
 import Control.Exception (try, finally)
 import Control.Monad (unless)
 import Text.JSON
-import System.FilePath ((</>))
 import System.IO.Error (isEOFError)
 
 import Ganeti.Path as Path
@@ -51,11 +50,6 @@ import qualified Ganeti.UDSServer as UDSServer
 import Ganeti.Metad.Config as Config
 import Ganeti.Metad.Types (InstanceParams)
 
-metadSocket :: IO FilePath
-metadSocket =
-  do dir <- Path.socketDir
-     return $ dir </> "ganeti-metad"
-
 -- | Update the configuration with the received instance parameters.
 updateConfig :: MVar InstanceParams -> String -> IO ()
 updateConfig config str =
@@ -97,8 +91,9 @@ acceptClients config server =
      acceptClients config server
 
 start :: DaemonOptions -> MVar InstanceParams -> IO ()
-start _ config =
-  do server <- UDSServer.connectServer metadConfig True =<< metadSocket
+start _ config = do
+     socket_path <- Path.defaultMetadSocket
+     server <- UDSServer.connectServer metadConfig True socket_path
      finally
        (acceptClients config server)
        (UDSServer.closeServer server)
diff --git a/src/Ganeti/Path.hs b/src/Ganeti/Path.hs
index 5f172f8..2b52d85 100644
--- a/src/Ganeti/Path.hs
+++ b/src/Ganeti/Path.hs
@@ -42,6 +42,7 @@ module Ganeti.Path
   , livelockFile
   , defaultQuerySocket
   , defaultWConfdSocket
+  , defaultMetadSocket
   , confdHmacKey
   , clusterConfFile
   , lockStatusFile
@@ -123,6 +124,10 @@ defaultQuerySocket = socketDir `pjoin` "ganeti-query"
 defaultWConfdSocket :: IO FilePath
 defaultWConfdSocket = socketDir `pjoin` "ganeti-wconfd"
 
+-- | The default MetaD socket for communication.
+defaultMetadSocket :: IO FilePath
+defaultMetadSocket = socketDir `pjoin` "ganeti-metad"
+
 -- | Path to file containing confd's HMAC key.
 confdHmacKey :: IO FilePath
 confdHmacKey = dataDirP "hmac.key"
-- 
2.2.0.rc0.207.ga3a616c

Reply via email to