Revision d5104ca4 src/Ganeti/Rpc.hs

b/src/Ganeti/Rpc.hs
90 90
import qualified Text.JSON as J
91 91
import Text.JSON.Pretty (pp_value)
92 92
import qualified Data.ByteString.Base64.Lazy as Base64
93
import System.Directory
93 94

  
94 95
import Network.Curl hiding (content)
95 96
import qualified Ganeti.Path as P
......
228 229
executeRpcCalls :: (Rpc a b) => [(Node, a)] -> IO [(Node, ERpcError b)]
229 230
executeRpcCalls nodeCalls = do
230 231
  cert_file <- P.nodedCertFile
231
  let (nodes, calls) = unzip nodeCalls
232
      opts = map (getOptionsForCall cert_file cert_file) calls
232
  client_cert_file_name <- P.nodedClientCertFile
233
  client_file_exists <- doesFileExist client_cert_file_name
234
  -- FIXME: This is needed to ensure upgradability to 2.11
235
  -- Remove in 2.12.
236
  let client_cert_file = if client_file_exists
237
                         then client_cert_file_name
238
                         else cert_file
239
      (nodes, calls) = unzip nodeCalls
240
      opts = map (getOptionsForCall cert_file client_cert_file) calls
233 241
      opts_urls = zipWith3 (\n c o ->
234 242
                         case prepareHttpRequest o n c of
235 243
                           Left v -> Left v

Also available in: Unified diff