Statistics
| Branch: | Tag: | Revision:

root / htest / Test / Ganeti / Types.hs @ 90634d95

History | View | Annotate | Download (14.2 kB)

# Date Author Comment
90634d95 12/19/2012 01:11 pm Iustin Pop

Extend job ID parsing tests

Since this is a type that behaves non-standard, let's add some more
test for "wrong" input values.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

5cd95d46 12/17/2012 01:29 pm Iustin Pop

Add a type for the log type in job/opcode logs

Also fixes indentation for OP_STATUS.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

bccb8d20 12/07/2012 05:43 pm Dato Simó

htest/Types.hs: check ordering of some ADTs

In some ADT, ordering of constructors is important because a certain
meaning is attached to ordinality (e.g., "clusters with lesser AllocPolicy
are preferred").

To ensure constructor order is not accidentally changed, this commit...

3bdbe4b3 12/05/2012 09:03 pm Dato Simó

Jobs.hs: move OpStatus and JobStatus ADTs to Types.hs

This leaves Ganeti/Jobs.hs and Test/Ganeti/Jobs.hs empty, but they're the
target of a future move of some functions, so we leave them around, and
don't delete them, to avoid unnecessary delete/create diffs....

c67b908a 12/04/2012 01:44 pm Iustin Pop

Add a negative type

This mirrors the positive one, and will be needed for relative job
IDs.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

b46ba79c 12/04/2012 01:44 pm Iustin Pop

Add types and parameters for common opcode implementation

This will go into a separate type; this patch adds the needed
underlying types and parameters.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

6903fea0 12/04/2012 01:44 pm Iustin Pop

Add type for finalised job statuses

For now, we don't need a pending job status type as well, so we'll
delay adding that until later.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

c48711d5 12/04/2012 01:44 pm Iustin Pop

Add a 'real' type for JobIds

Currently, the job ID is a simple type alias. This is suboptimal, as
it means we can't use a custom JSON (or Arbitrary) instance for it.

The patch changes it into a newtype, and then a) simplifies some
deserialisation code and b) changes some more fields to this new type...

c2d3219b 11/30/2012 03:54 pm Iustin Pop

Complete the instance OpCodes and parameters

Only the original instance opcodes (used in htools) are left
non-converted to only parameter style; they'll be cleaned up later,
once the htools codebase itself migrates to safer types.

Signed-off-by: Iustin Pop <>...

398e9066 11/30/2012 03:54 pm Iustin Pop

Add Group, OS and Backup opcodes

This also corrects a docstring in OpBackupExport on the Python side.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

a3f02317 11/30/2012 03:54 pm Iustin Pop

Complete the Test opcodes

This adds the OpTestAllocator, OpTestJqueue and OpTestDummy
opcodes. The OpTestAllocator seems to need some cleanup (on the Python
side), for now we implement it as is. As for the other two, while not
used in production, we should have full coverage for them as well....

497beee2 11/30/2012 03:54 pm Iustin Pop

Move NICMode from Objects.hs to Types.hs

Also add some unittests for this type.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

8d239fa4 11/30/2012 03:54 pm Iustin Pop

Add types, parameters and the opcodes for networks

This completes the last missing opcode group. The only difficulty was
with the ip addresses, where we used simple strings to represent them
and (for IPv4) a few helpers to generate arbitrary instances;
otherwise, the patch is trivial....

6d558717 11/30/2012 03:48 pm Iustin Pop

Add types and parameters for OpInstanceCreate

This is a "big" opcode, so sending it separately.

A few types needed changing, and a few parameters were renamed to make
it more clear which are cluster-level and which are instance-level
parameters.

Signed-off-by: Iustin Pop <>...

c65621d7 11/30/2012 03:48 pm Iustin Pop

Move FileDriver from Objects to Types

Another base type that we need in opcodes as well.

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

6a28e02c 11/21/2012 04:58 pm Iustin Pop

Add two more basic types

These are needed for completing the node opcode parameters.

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

48755fac 11/21/2012 03:51 pm Iustin Pop

Move StorageType from RPC.hs to Types.hs

This fixes a FIXME actually recommending this move :)

Signed-off-by: Iustin Pop <>
Reviewed-by: Guido Trotter <>

22381768 11/21/2012 03:51 pm Iustin Pop

Move the 'Hypervisor' type from Objects to Types

This is a very basic type and 'Objects' is a heavy-weight module. By
moving it to 'types' we simplify (in the future) the import chains.

Signed-off-by: Iustin Pop <>
Reviewed-by: Adeodato Simo <>

d696bbef 11/21/2012 03:51 pm Iustin Pop

Add more basic Ganeti types

These are needed both in opcodes and (potentially) outside, so we add
them in the main Types module.

Signed-off-by: Iustin Pop <>
Reviewed-by: Michael Hanselmann <>

39573352 11/20/2012 08:04 pm Iustin Pop

Fix some more hlint warnings

Sorry…

Signed-off-by: Iustin Pop <>
Reviewed-by: Helga Velroyen <>

edb5a1c8 11/20/2012 05:39 pm Iustin Pop

Add more basic validation types

This mirrors the ht.py types PositiveInt, NonNegative, etc., except
that they work at a more generic level (any numeric type, respectively
any non-empty list).

Signed-off-by: Iustin Pop <>
Reviewed-by: Adeodato Simo <>

5e9deac0 11/20/2012 11:16 am Iustin Pop

Create a new Ganeti/Types.hs module

There are already three cases where we copied type definitions between
the htools-specific types into the main ganeti code. Let's stop doing
this ☺ and create a common types module that holds these.

Note that there already exists BasicTypes.hs, but that refers to very...