Revision 45f75526 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 |
|
94 | 93 |
|
95 | 94 |
import Network.Curl hiding (content) |
96 | 95 |
import qualified Ganeti.Path as P |
... | ... | |
229 | 228 |
executeRpcCalls :: (Rpc a b) => [(Node, a)] -> IO [(Node, ERpcError b)] |
230 | 229 |
executeRpcCalls nodeCalls = do |
231 | 230 |
cert_file <- P.nodedCertFile |
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 |
|
231 |
let (nodes, calls) = unzip nodeCalls |
|
232 |
opts = map (getOptionsForCall cert_file cert_file) calls |
|
241 | 233 |
opts_urls = zipWith3 (\n c o -> |
242 | 234 |
case prepareHttpRequest o n c of |
243 | 235 |
Left v -> Left v |
Also available in: Unified diff