commit 7e0a74a59daa0171eb648f7ef1020e863506432d
Merge: bab1c63 c7a2958
Author: Lisa Velden <[email protected]>
Date:   Mon Aug 3 13:45:42 2015 +0200

    Merge branch 'stable-2.12' into stable-2.13

    * stable-2.12
      Correct indendation
      In confd provide proper serial number

    * stable-2.11
      (no changes)

    * stable-2.10
      Add a new unit test for LUInstanceMultiAlloc
      Fix a bug in LUInstanceMultiAlloc LU

    Conflicts:
              lib/bootstrap.py

    Resolution:
            lib/bootstrap.py: take indendation from stable-2.12

    Semantical conflicts:
            src/Ganeti/Confd/Server.hs: add serial number to new queries

diff --cc src/Ganeti/Confd/Server.hs
index 9f9aadf,7af7f0a..fac0537
--- a/src/Ganeti/Confd/Server.hs
+++ b/src/Ganeti/Confd/Server.hs
@@@ -240,32 -246,12 +249,36 @@@ buildResponse cdata req@(ConfdRequest
      case confdRqQuery req of
        PlainQuery str -> return str
        _ -> fail $ "Invalid query type " ++ show (confdRqQuery req)
+   inst <- lookupContainer (Bad $ "unknown instance: " ++ inst_uuid)
+             inst_uuid $ configInstances cfg
    case getInstDisks cfg inst_uuid of
-     Ok disks -> return (ReplyStatusOk, J.showJSON disks)
+     Ok disks -> return (ReplyStatusOk, J.showJSON disks, instSerial inst)
      Bad e -> fail $ "Could not retrieve disks: " ++ show e

 +-- | Return arbitrary configuration value given by a path.
 +buildResponse cdata req@(ConfdRequest { confdRqType = ReqConfigQuery
 +                                      , confdRqQuery = pathQ }) = do
 +  let cfg = fst cdata
 +  path <-
 +    case pathQ of
 +      PlainQuery path -> return path
 +      _ -> fail $ "Invalid query type " ++ show (confdRqQuery req)
 +  let configValue = extractJSONPath path cfg
 +  case configValue of
-     J.Ok jsvalue -> return (ReplyStatusOk, jsvalue)
++    J.Ok jsvalue -> return (ReplyStatusOk, jsvalue,
++                            clusterSerial $ configCluster cfg)
 +    J.Error _ -> return queryArgumentError
 +
 +-- | Return activation state of data collectors
 +buildResponse (cdata,_) (ConfdRequest { confdRqType = ReqDataCollectors
}) = do
 +  let mkConfig col =
 +        (dName col, DataCollectorConfig
 +                   (dActive col (dName col) cdata)
 +                   (dInterval col (dName col) cdata))
 +      datacollectors = containerFromList $ map mkConfig collectors
-   return (ReplyStatusOk, J.showJSON datacollectors)
++  return (ReplyStatusOk, J.showJSON datacollectors,
++          clusterSerial . configCluster $ cdata)
 +
  -- | Creates a ConfdReply from a given answer.
  serializeResponse :: Result StatusAnswer -> ConfdReply
  serializeResponse r =

-- 
Lisa Velden
Software Engineer
[email protected]

Google Germany GmbH
Dienerstraße 12
80331 München

Geschäftsführer: Graham Law, Christine Elizabeth Flores
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg

Reply via email to