This patch adds missing Path entry and uses it in Rpc. It was not in
place before due to different build settings - i.e. if curl was
disabled, there were no problems.

Signed-off-by: Agata Murawska <[email protected]>
---
 htools/Ganeti/Path.hs |    5 +++++
 htools/Ganeti/Rpc.hs  |    7 ++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/htools/Ganeti/Path.hs b/htools/Ganeti/Path.hs
index 5f439dd..ee102d5 100644
--- a/htools/Ganeti/Path.hs
+++ b/htools/Ganeti/Path.hs
@@ -31,6 +31,7 @@ module Ganeti.Path
   , runDir
   , confdHmacKey
   , clusterConfFile
+  , nodedCertFile
   ) where
 
 import qualified Ganeti.Constants as C
@@ -68,3 +69,7 @@ confdHmacKey = dataDir </> "hmac.key"
 -- | Path to cluster configuration file
 clusterConfFile :: FilePath
 clusterConfFile  = dataDir </> "config.data"
+
+-- | Path
+nodedCertFile  :: FilePath
+nodedCertFile = dataDir </> "server.pem"
diff --git a/htools/Ganeti/Rpc.hs b/htools/Ganeti/Rpc.hs
index 77a0686..f78dceb 100644
--- a/htools/Ganeti/Rpc.hs
+++ b/htools/Ganeti/Rpc.hs
@@ -60,6 +60,7 @@ import Text.JSON (makeObj)
 
 #ifndef NO_CURL
 import Network.Curl
+import qualified Ganeti.Path as P
 #endif
 
 import qualified Ganeti.Constants as C
@@ -72,13 +73,13 @@ import Ganeti.JSON
 -- | The curl options used for RPC.
 curlOpts :: [CurlOption]
 curlOpts = [ CurlFollowLocation False
-           , CurlCAInfo C.nodedCertFile
+           , CurlCAInfo P.nodedCertFile
            , CurlSSLVerifyHost 0
            , CurlSSLVerifyPeer True
            , CurlSSLCertType "PEM"
-           , CurlSSLCert C.nodedCertFile
+           , CurlSSLCert P.nodedCertFile
            , CurlSSLKeyType "PEM"
-           , CurlSSLKey C.nodedCertFile
+           , CurlSSLKey P.nodedCertFile
            , CurlConnectTimeout (fromIntegral C.rpcConnectTimeout)
            ]
 #endif
-- 
1.7.7.3

Reply via email to