| Branch: | Tag: | Revision:

root / htools @ 66ad857a

Name Size
haddock-prologue 251 Bytes
hconfd.hs 1.2 kB
htools.hs 2 kB
lint-hints.hs 669 Bytes
rpc-test.hs 1.6 kB

Latest revisions

# Date Author Comment
66ad857a 10/26/2012 02:22 pm Iustin Pop

Fix a few issues found by newer hlint

Testing with a newer hlint found a few minor issues; but all are real,
valid recommendations:

- don't use "if cond then f x else f y", but "f (if cond then x else y)"
- "if a then b else True" is equivalent to the simpler "not a || b"...

9b156883 10/26/2012 02:22 pm Iustin Pop

Add support for optional fields with null serialised

This follows a conversation we had for how to deal with
optional-but-required fields in JSON serialisations: fields which are
optional (can be either a given type or 'null'), but where the 'null'
value is required. There are just a few of these in the Python code,...

86a24969 10/25/2012 08:57 pm Dato Simó

Errors.hs: improve field names for ConfigVersionMismatch

Change {exp,act}Code to {exp,act}Ver, which gives a better idea that
the integer fields represent version numbers.


- update OpPrereqError's docstring to note that an error
code is always expected as the second argument (it was previously...
dce5d027 10/25/2012 06:43 pm Dato Simó

THH.hs: delete isOptional, no longer used

The isOptional function is no longer used after a150585 (“Convert
opcode TH code to the use of Field type”).

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

5183e8be 10/25/2012 01:05 pm Iustin Pop

Convert query path from string errors to GanetiException

This patch converts all the call paths from 'Result' (which contains
just string errors) to 'ErrorResult', which holds
GanetiException-encoded errors. We can now return proper
OpPrereq/OpExec errors to the clients of the luxi/query socket....

f56fc1a6 10/25/2012 01:05 pm Iustin Pop

Add exception utility functions

In Python, formatError also returns the exit code, but I find that
splitting them leads to clearer code.

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

ef3ad027 10/25/2012 12:38 pm Iustin Pop

Add an Errors module mirroring the Python one

As described in the module doc string, while writing this it dawned
upon me that we're mixing all errors together into a single hierarchy
(well, type on the Haskell side), which is not good. Some errors are
used purely within noded, some in the CLI frontends, etc. so these...

185b5b0d 10/25/2012 12:38 pm Iustin Pop

Abstract Luxi template functionality

These are almost generic, so let's change the signatures a bit a make
them fully so.

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

2e202a9b 10/25/2012 12:38 pm Iustin Pop

Abstract a few types in THH.hs

This 'simple' way of defining objects will be used also for errors, so
let's make it less Luxi-specific.

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

77ffd663 10/22/2012 12:31 pm Helga Velroyen

Fix setting of 'failN1' flag for corner case

This patch includes:

  • The 'failN1' flag is now only set if there is strictly less
    memory available than required for failover.
  • Unit tests for that.

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

View revisions

Also available in: Atom