Also export a null ISpec
authorKlaus Aehlig <aehlig@google.com>
Wed, 25 Mar 2015 16:01:18 +0000 (17:01 +0100)
committerKlaus Aehlig <aehlig@google.com>
Thu, 26 Mar 2015 14:21:33 +0000 (15:21 +0100)
This is an ISpec for an instance with 0 resources. It can serve as a trivial
lower bound where we have to provide one but do not actually care.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

test/hs/Test/Ganeti/TestHTools.hs

index c4a3b6a..2817f2e 100644 (file)
@@ -36,6 +36,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 module Test.Ganeti.TestHTools
   ( nullIPolicy
+  , nullISpec
   , defGroup
   , defGroupList
   , defGroupAssoc
@@ -58,17 +59,21 @@ import qualified Ganeti.HTools.Types as Types
 
 -- * Helpers
 
+-- | An ISpec with 0 resources.
+nullISpec :: Types.ISpec
+nullISpec = Types.ISpec { Types.iSpecMemorySize = 0
+                        , Types.iSpecCpuCount   = 0
+                        , Types.iSpecDiskSize   = 0
+                        , Types.iSpecDiskCount  = 0
+                        , Types.iSpecNicCount   = 0
+                        , Types.iSpecSpindleUse = 0
+                        }
+
 -- | Null iPolicy, and by null we mean very liberal.
 nullIPolicy :: Types.IPolicy
 nullIPolicy = Types.IPolicy
   { Types.iPolicyMinMaxISpecs = [Types.MinMaxISpecs
-    { Types.minMaxISpecsMinSpec = Types.ISpec { Types.iSpecMemorySize = 0
-                                              , Types.iSpecCpuCount   = 0
-                                              , Types.iSpecDiskSize   = 0
-                                              , Types.iSpecDiskCount  = 0
-                                              , Types.iSpecNicCount   = 0
-                                              , Types.iSpecSpindleUse = 0
-                                              }
+    { Types.minMaxISpecsMinSpec = nullISpec
     , Types.minMaxISpecsMaxSpec = Types.ISpec
       { Types.iSpecMemorySize = maxBound
       , Types.iSpecCpuCount   = maxBound