diff --git a/src/Ganeti/Network.hs b/src/Ganeti/Network.hs index 45168bc91f73828532847657a212072b1a0962e8..510621396cf5f0a6ba693a120042d4ec70641508 100644 --- a/src/Ganeti/Network.hs +++ b/src/Ganeti/Network.hs @@ -7,7 +7,7 @@ corresponding python implementation (network.py). {- -Copyright (C) 2011, 2012 Google Inc. +Copyright (C) 2011, 2012, 2013 Google Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,6 +42,8 @@ import qualified Data.Vector.Unboxed as V import Ganeti.Objects +-- | An address pool, holding a network plus internal and external +-- reservations. data AddressPool = AddressPool { network :: Network, reservations :: V.Vector Bool, extReservations :: V.Vector Bool } @@ -61,7 +63,8 @@ createAddressPool n -- | Checks the consistency of the network object. So far, only checks the -- length of the reservation strings. networkIsValid :: Network -> Bool -networkIsValid n = sameLength (networkReservations n) (networkExtReservations n) +networkIsValid n = + sameLength (networkReservations n) (networkExtReservations n) -- | Checks if two maybe strings are both nothing or of equal length. sameLength :: Maybe String -> Maybe String -> Bool @@ -100,4 +103,3 @@ isFull = V.and . allReservations getMap :: AddressPool -> String getMap = V.toList . V.map mapPixel . allReservations where mapPixel c = if c then 'X' else '.' -