Revision 557f5dad

b/src/Ganeti/JQueue.hs
58 58
    , startJobs
59 59
    ) where
60 60

  
61
import Control.Arrow (second)
61 62
import Control.Concurrent.MVar
62 63
import Control.Exception
63 64
import Control.Monad
65
import Data.Functor ((<$))
64 66
import Data.List
65 67
import Data.Maybe
66 68
import Data.Ord (comparing)
67 69
-- workaround what seems to be a bug in ghc 7.4's TH shadowing code
68
import Prelude hiding (log, id)
70
import Prelude hiding (id, log)
69 71
import System.Directory
70 72
import System.FilePath
71 73
import System.IO.Error (isDoesNotExistError)
......
381 383
replicateJob rootdir mastercandidates job = do
382 384
  let filename = liveJobFile rootdir . qjId $ job
383 385
      content = Text.JSON.encode . Text.JSON.showJSON $ job
384
  result <- executeRpcCall mastercandidates
385
              $ RpcCallJobqueueUpdate filename content
386
  callresult <- executeRpcCall mastercandidates
387
                  $ RpcCallJobqueueUpdate filename content
388
  let result = map (second (() <$)) callresult
386 389
  logRpcErrors result
387 390
  return result
388 391

  
b/src/Ganeti/Rpc.hs
567 567
  , simpleField "content" [t| String |]
568 568
  ])
569 569

  
570
$(buildObject "RpcResultJobQueueUpdate" "rpcResultJobQueueUpdate" [])
571

  
570 572
instance RpcCall RpcCallJobqueueUpdate where
571 573
  rpcCallName _          = "jobqueue_update"
572 574
  rpcCallTimeout _       = rpcTimeoutToRaw Fast
......
579 581
      )
580 582
    )
581 583

  
582
instance Rpc RpcCallJobqueueUpdate () where
584
instance Rpc RpcCallJobqueueUpdate RpcResultJobQueueUpdate where
583 585
  rpcResultFill _ res =
584 586
    case res of
585
      J.JSNull ->  Right ()
587
      J.JSNull ->  Right RpcResultJobQueueUpdate
586 588
      _ -> Left $ JsonDecodeError
587 589
           ("Expected JSNull, got " ++ show (pp_value res))
588 590

  

Also available in: Unified diff