| Branch: | Tag: | Revision:

root / htools / Ganeti / OpCodes.hs @ 37904802

History | View | Annotate | Download (5.9 kB)

# Date Author Comment
d8e7c45e 11/12/2012 12:00 pm Iustin Pop

Convert tag objects to a safer type

Currently, we keep information about the "target" of a tag operation
in a data type similar to (TagKind, Maybe String). This is unsafe, as
nothing (at the type level) prevents us from accidentally having
(TagCluster, Just ""), or (TagInstance, Nothing)....

3bebda52 11/08/2012 12:31 pm Dato Simó

OpCodes.hs: add OpTagsSet and OpTagsDel

Also, adjust comment to $(genOpCode) block to avoid repetition of

Signed-off-by: Dato Simó <>
Reviewed-by: Iustin Pop <>

367c4241 11/08/2012 12:31 pm Dato Simó

htools: move TagObject from Luxi.hs to OpCodes.hs

In addition to ReqQueryTags in Luxi.hs, the TagObject ADT is also
required for the "kind" attribute of OpTagsSet and OpTagsDel, which
are coming to OpCodes.hs next. Hence, we move TagObject there, and
adjust imports accordingly....

f3baf5ef 09/04/2012 04:51 pm Iustin Pop

Move JSON.hs and Compat.hs out from under HTools/

These two files are not htools-specific, so let's move them out of the
HTools subdirectory/module hierarchy and directly under Ganeti.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

4a1dc2bf 08/28/2012 06:04 pm Iustin Pop

Create a custom type for disk indices

While (again) trying to test Python/Haskell encoding interoperability,
I found another bug: the disk index is declared in Python as
ht.TPositiveInt, but in Haskell just as Int, so it can take negative
values too. Clearly we can do better, so let's add a wrapper type that...

a583ec5d 08/28/2012 06:03 pm Iustin Pop

OpCodes: build and export a list of all opcodes

This can be used for cross-checking with the Python code for
consistency on defined opcodes.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

b69be409 01/13/2012 03:16 pm Iustin Pop

Stop exporting JSON functionality from Utils.hs

This completes the Utils/JSON split started in commit f047f90f. The
import graph should be cleaner now.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

a1505857 12/07/2011 12:00 pm Iustin Pop

Convert opcode TH code to the use of Field type

This makes more explicit the field behaviour - previously an optional
field was detected via a "Maybe" constructor, and an optional one via
a "Just defval" one. With this, field behaviour become more explicit...

ebf38064 11/17/2011 03:49 pm Iustin Pop

htools: reindent the rest of the files

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

12c19659 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell to generate opcode serialisation

This replaces the hand-coded opcode serialisation code with
auto-generation based on TemplateHaskell.

Signed-off-by: Iustin Pop <>
Reviewed-by: Agata Murawska <>

6111e296 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell to build the opID function

This replaces the hand-coded opID with one automatically generated
from the constructor names, similar to the way Python does it, except
it's done at compilation time as opposed to runtime.

Again, the code line delta does not favour this patch, but this...

e9aaa3c6 10/03/2011 12:17 pm Iustin Pop

Use TemplateHaskell instead of hand-coded instances

This patch replaces the current hard-coded JSON instances (all alike,
just manual conversion to/from string) with auto-generated code based
on Template Haskell

bbe9758d 07/22/2011 01:53 pm Iustin Pop

htools: add target_node member to migrate opcode

… and failover too. Not many changes otherwise except for
serialisation and unittests.

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

525bfb36 07/13/2011 01:01 pm Iustin Pop

htools: docstring fixes and improvements

No code changes (except one definition being moved around in QC.hs)
are contained in this patch.

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

10028866 04/07/2011 01:56 pm René Nussbaumer

htools: Make opcode naming consistent with Ganeti codebase

This patch just cleans up the htools codebase to make it more consistent
with the naming of the Ganeti codebase.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Iustin Pop <>

9470b6ee 04/07/2011 12:36 pm Iustin Pop

OpCodes.hs: make allow_failover optional

And default to False, like in the Python codebase.

Signed-off-by: Iustin Pop <>
Reviewed-by: René Nussbaumer <>

8d66f58a 04/06/2011 08:01 pm René Nussbaumer

htools: Use OpMigrateInstance with allow_failover option

Before hbal decided on the fly if an instance is migratable or not. As
we implemented failover fallback in commit d5cafd31456 we can start to
use that.

Signed-off-by: René Nussbaumer <>...

dc384cf0 03/17/2011 06:04 pm Iustin Pop

Merge remote branch 'htools/master'

  • htools/master: (605 commits)
    Update NEWS file for version 0.3.1
    Update copyright years in the man pages
    Remove obsolete env vars from the manpages
    Fix dist archive generation
    luxi backend: show attribute names in errors...