Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / OpParams.hs @ 1ba01ff7

History | View | Annotate | Download (42.4 kB)

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

Add a few tests for OpParams types

As OpParams definitions are used at Template Haskell type, they don't
get any coverage (although the values defined by them are actually
used in unittests). However, we can at least test some of the
functions defined in the module....

1496f5f3 12/17/2012 01:38 pm Iustin Pop

Make two common opcode parameters always serialised

This changes deps and comment fields to always be shown, to match the
Python behaviour for (at least) job listing/ops field.

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

88127c47 12/17/2012 01:38 pm Iustin Pop

Fix disk_template OpInstSetParams parameter

This is not a required field, but rather an optional one; we add a new
parameter and use it instead.

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

ad1c1e41 12/17/2012 01:29 pm Iustin Pop

Implement opcode summary support

This implements in the Haskell codebase the opcode summary. As opposed
to Python, we always use custom code for formatting, since we don't
want to use dynamic attribute lookup.

To test this properly, we need to change MetaOpCode to record-syntax,...

60f20a41 12/17/2012 01:29 pm Iustin Pop

Fix small typo in OpTestDelay/duration definition

The extra space results in inaccessible names; currently GHC doesn't
flag this as an error, but I've filled an upstream bug for that
(http://hackage.haskell.org/trac/ghc/ticket/7484).

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

1f1188c3 12/07/2012 02:36 pm Michael Hanselmann

cmdlib: Opportunistic locking on instance creation

Adds a new parameter to “OpInstanceCreate” and “OpInstanceMultiAlloc” to
use opportunistic locks.

Signed-off-by: Michael Hanselmann <>
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 <>

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

Rework custom fields handling

This patch changes a bit the handling of custom fields. Since in
general we use custom fields to aggregate multiple entries in the JSON
object into a safer data-type, we should also have a way to declare
which extra entries this field covers (so that in the future we can...

67fc4de7 12/04/2012 01:44 pm Iustin Pop

Add a few missing fields from opcodes

Due to manual conversion, a few fields were missing from the
conversion, but as they were optional our type equivalence checking
didn't detect this.

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

139c0683 11/30/2012 03:54 pm Iustin Pop

Remove read instances from our Haskell code

It turns out that optimising 'read' derived instances (via -O) for
complex data types (like OpCode, or the various objects) can be slow
to very slow. Disabling such instances results in (time make
$all_our_haskell_binaries) large compile-time savings and also smaller...

7d421386 11/30/2012 03:54 pm Iustin Pop

Remove remaining in-line parameters

… except one, and replace them with separately-defined ones in
OpParams.

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

3131adc7 11/30/2012 03:54 pm Iustin Pop

Abstract query common opcode definitions

It would be even better if the opcodes would actually have all the
same definitions, until then we have two sets of definitions.

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

1cd563e2 11/30/2012 03:54 pm Iustin Pop

Add two last missing opcodes

OpInstanceQuery was missing accidentally, whereas OpRestrictedCommand
was just recently added without Haskell definitions.

The patch also slightly improves the OpNodeQuery arbitrary generation.

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

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....

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....

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

Complete the Tag opcodes and fix OpTestDelay missing param

The regexp in OpTagsSearch is loaded as is, without testing for
validity; the rest of the patch is trivial.

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

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 <>

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 <>...

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 <>...

d6979f35 11/21/2012 04:58 pm Iustin Pop

Add many more opcode parameters

This is a bulk add of all node parameters needed for node and cluster
opcodes. The parameters are defined with a few helper functions in
this module, and, opposite from opcodes.py, there won't be any (new)
opcode attributes declared in-line (without a separate field...

417ab39c 11/21/2012 04:58 pm Iustin Pop

A few more hlint fixes

I'm ignoring the use of Control.Arrow.*** since it's a non-obvious
function, and we're not widely using Arrows in the code base, so I
think switching to it would make the code less readable to most
people.

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

92f51573 11/20/2012 11:16 am Iustin Pop

Split OpCode.hs and add module for opcode parameters

Due to TemplateHaskell stage restrictions, we can't define parameters
in the same module as we're using them for TH, so we have to define
all module parameters in a separate module.

This patch therefore splits OpCodes.hs in two, adding that module and...