On Tue, May 19, 2015 at 02:31:01PM +0200, 'BSRK Aditya' via ganeti-devel wrote:
> They include updateCluster, updateNode,
> updateInstance, updateNodegroup, updateNetwork,
> updateDisk.
> 
> Signed-off-by: BSRK Aditya <[email protected]>
> ---
>  src/Ganeti/WConfd/ConfigModifications.hs | 109 
> +++++++++++++++++++++++++++++++
>  1 file changed, 109 insertions(+)
> 
> diff --git a/src/Ganeti/WConfd/ConfigModifications.hs 
> b/src/Ganeti/WConfd/ConfigModifications.hs
> index d2fe008..1074243 100644
> --- a/src/Ganeti/WConfd/ConfigModifications.hs
> +++ b/src/Ganeti/WConfd/ConfigModifications.hs
> @@ -129,6 +129,36 @@ getAllMACs :: ConfigState -> S.Set String
>  getAllMACs = S.fromList . map nicMac . concatMap instNics . M.elems
>             . fromContainer . configInstances . csConfigData
>  
> +-- | Checks if the two objects given have the same serial number
> +checkSerial :: SerialNoObject a => a -> a -> GenericResult GanetiException ()
> +checkSerial target current = if serialOf target == serialOf current
> +  then Ok ()
> +  else Bad . ConfigurationError $ printf
> +    "Configuration object updated since it has been read: %d != %d"
> +    (serialOf current) (serialOf target)
> +
> +-- | Updates an object present in a container.
> +-- The presense of the object in the container
> +-- is determined by the uuid of the object.
> +--
> +-- A check that serial number of the
> +-- object is consistent with the serial number
> +-- of the object in the container.
> +-- 

Please don't add new trailing whitespace.

Rest LGTM

-- 
Klaus Aehlig
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to