Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti / HTools @ 37904802

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

Change type of program options to 'IO [Options]'

Some options have defaults that depend on the environment, and we
could handle these in two ways:

- use a place-holder value (e.g. data X a = Default | Custom a) that
is later read from the environment
- move the options list to IO monad, where it can read the...

b9612abb 11/07/2012 03:06 pm Iustin Pop

Merge branch 'devel-2.6' into submit

  • devel-2.6:
    Fix compatibility with newer Haskell libraries
    Fix gnt-instance console with xl

Conflicts:
Makefile.am (reordering, fixed)
htools/Ganeti/Confd/Server.hs (hlint fixes on master)
htools/Ganeti/Daemon.hs (hlint)...

27639c4e 11/07/2012 02:08 pm Iustin Pop

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    Fix compatibility with newer Haskell libraries
    Fix gnt-instance console with xl

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

1251817b 11/07/2012 10:46 am Iustin Pop

Fix compatibility with newer Haskell libraries

This small patch fixes compatibility with a few newer Haskell libraries:

- base 4.6, included with ghc 7.6, removed the deprecated 'catch'
function from Prelude, so our "import Prelude hiding (catch)" is now...

7adb7dff 10/26/2012 06:05 pm Iustin Pop

Convert Luxi results to Ganeti errors

This a bit too complex patch converts the result of Luxi calls
(submitJob, query*, etc.) from Result to ErrorResult. It then
immediately revers this in the HTools/Backend/Luxi module, where we
don't need necessarily the full error type (just a nice error...

879d9290 10/26/2012 03:05 pm Iustin Pop

Move htools backends to a separate directory

Five modules under the HTools/ directories are backend
implementations, so let's move them to a separate directory, to more
clearly show the hierarchy. I wanted to do this for a while, but
merging between branches is always an issue, so let's do it know since...

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

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

dd77da99 10/22/2012 12:29 pm Helga Velroyen

A few unittests improvements

Small simplifications of other unit tests using the (==?)
operator when possible, and typo fixes.

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

a8038349 10/18/2012 01:55 pm Iustin Pop

Remove custom OpResult type/monad

Since we now have the GeneralResult as a multi-purpose monad, we can
remove the custom OpResult monad, and just use 'GeneralResult
FailMode' as our type. This allows removal of a few bits of
specialised infrastructure, relying instead on the generic one....

707cd3d7 10/18/2012 12:11 pm Helga Velroyen

Use exitErr instead of explicit error message and exitWith

Furthermore, a few messages have their capitalisation changed (fixed).

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

659d769d 10/17/2012 07:45 pm Dato Simó

Merge branch 'devel-2.6' into master

  • devel-2.6:
    htools-excl.test: add test case for exclusion tags in hbal
    Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'
    Group.hs: add 'allTags'; adjust loaders and test data for it
    Add hbal-excl-tags.data to Makefile.am, missed in 0397694...
6b6e335b 10/17/2012 04:13 pm Dato Simó

Group.hs: add 'allTags'; adjust loaders and test data for it

This commit adds a Group.allTags field to store the tags of node groups,
and teaches each loader backend in HTools to populate it (additionally, the
IAllocator class in lib/cmdlib.py now includes tags for groups too). Test...

2f907bad 10/17/2012 04:13 pm Dato Simó

Instance.hs: rename 'tags' to 'exclTags', provide 'allTags'

The mergeData function in Loader.hs included a step to filter an instance's
tags to include only the exclusion tags (as specified via the commandline,
or cluster-level tags). Later on, code in Node.hs assumed Instance.tags to...

11f53fdb 10/16/2012 05:43 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    ensure-dirs: Fix permissions on master socket
    Update security document for version 2.6
    Update NEWS and bump version to 2.6.1
    Text.hs: update field lists in parseData comments

Conflicts:
NEWS: Trivial
lib/tools/ensure_dirs.py: constant moved to pathutils...

01e52493 10/15/2012 07:56 pm Iustin Pop

Cleanup HTools.Types/BasicTypes imports

Before we reorganised the source tree, the 'Result' type was exported
from HTools/Types.hs. This changed during the reorg, but at that time
we didn't change the exports; instead, we kept re-exporting it from
the old module for compatibility....

b0b8337a 10/11/2012 03:21 pm Dato Simó

Text.hs: update field lists in parseData comments

The comments in parseData had become out of date with the implementations
of load{Group,Node,Inst}. This commit updates the field list in comments to
match the implementations.

Signed-off-by: Dato Simó <>...

4cd79ca8 10/11/2012 01:03 pm Iustin Pop

Cleanup network timeouts and htools imports

This patch removes the last HTools module imports from non-htools code
(the HTools.Types module), but it requires an associated cleanup:
using luxi-specific constants for luxi timeouts (the only effect is
that one timeout decreases from 15 to 10, the default value in the...

ecebe9f6 10/08/2012 02:07 pm Iustin Pop

Split the OptComplNumeric into integer/float ones

This allows the command completion to treat them as separate option
types; this is not useful in build-bash-completion right now, but
might become so in the future.

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

22278fa7 10/08/2012 02:06 pm Iustin Pop

Define the actual arguments that are supported by programs

This defines the arguments supported and then modifies the
--help-completion output to include them too.

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

26d62e4c 10/08/2012 12:35 pm Iustin Pop

Rename Ganeti/HTools/Utils.hs to Ganeti/Utils.hs

This is, I believe, the last non-htools specific file that still lived
in the htools directory; it's already widely used in non-htools code,
so let's move it before we add more functionality to this module....

097ad7ee 09/26/2012 02:18 pm Iustin Pop

Add option for displaying completion information

This patch adds support for a --help-completion option, which will
display the defined options and their completion information, in a
format designed to be parsed easily from Python, for integration into
build-bash-completion....

ce207617 09/26/2012 02:18 pm Iustin Pop

Annotate options with completion information

This is a quite boring patch, just adding annotation information to
all existing options. Some of the annotations are not very good; but
we don't have support for more precise completion in
build-bash-completion, so this is good enough....

42834645 09/26/2012 02:18 pm Iustin Pop

Remove generic options from individual programs

Currently, we test and require that each individual program (hbal,
etc.) defines/supports the generic options (currently --help and
--version). Even with the test, this is not optimal, since it requires
changes in many places whenever we modify the list of generic options,...

d1da5a45 09/26/2012 12:46 pm Iustin Pop

Add printing of group score in hinfo

The global cluster score is less interesting than individual group
scores, for multi-group allocation purposes.

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

da28218d 09/26/2012 12:46 pm Iustin Pop

Replace a big tuple with a custom data type

This will make it easier to add new parameters.

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

9eeb0aa5 09/18/2012 06:11 pm Michael Hanselmann

Use autoconf-based paths from Haskell instead of constants

Future changes will change Path.hs to use an environment variable.

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

107102af 09/08/2012 12:19 am Iustin Pop

Merge branch 'devel-2.6' into submit

  • devel-2.6:
    Fix bug in non-mirrored instance allocation
    Fix gnt-debug iallocator

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

14b5d45f 09/08/2012 12:00 am Iustin Pop

Fix bug in non-mirrored instance allocation

The function `allocateOnSingle' has a bug in the calculation of the
cluster score used for deciding which of the many target nodes to use
in placing the instance: it uses the original node list for the score
calculation....

5b11f8db 09/05/2012 05:31 pm Iustin Pop

Further hlint fixes

Commit 2cdaf22, “Re-enable standard hlint warnings”, got it almost
right. The only problem is that (confusingly) the default set of hints
is not in HLint.Default, but in HLint.HLint (it includes Default and
some built-ins).

After changing the lint file to correctly include the defaults, we had...

51000365 09/05/2012 05:31 pm Iustin Pop

Rework CLI modules and tests

While investigating how we could test the Daemon.hs module, I realised
that we have a very, erm, sub-optimal situation:

- HTools/CLI.hs has a nice IO/pure separation testing in cmdline
parsing, which allows some basic functionality to be tested, but...

2997cb0a 09/05/2012 03:33 pm Iustin Pop

Move Version.hs up from under HTools/

This is another module that is generic, and not htools-specific.

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

b88fcdd0 09/04/2012 05:25 pm Iustin Pop

Remove QC.hs and replace it with an auto-generated file

In order to have correct code coverage results, we must somehow import
all production modules into the test runner. Until now, this was done
manually (when we didn't forget) in QC.hs.

To improve the situation, we remove QC.hs and replace it with an...

2d87bd0a 09/04/2012 04:51 pm Iustin Pop

Split last two remaining tests from QC.hs

This makes QC.hs obsolete, but we will remove it in a later patch,
once we automatically build a file with all the imports (to ensure
correct coverage results).

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

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

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

Split most HTools test code into separate files

Except for Ganeti.HTools.JSON, which needs rename, we split all the
other test suites into separate files.

We have to add another common test helper, due to import dependencies
(sigh), but otherwise this split is pretty straightforward....

aed2325f 09/04/2012 04:50 pm Iustin Pop

Split Luxi, Qlang, Ssconf and OpCodes tests

… from QC.hs into their own files, again mirroring the production code
source tree.

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

305e174c 09/04/2012 04:50 pm Iustin Pop

Split Rpc tests from QC

This required lots of other code moves, so I created it as a
standalone patch.

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

2733df51 09/04/2012 04:50 pm Iustin Pop

Split one more module out of QC and add test helpers

This splits the confd/utils tests, and adds the TestCommon module for
shared test code.

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

e5a29b6c 09/04/2012 04:50 pm Iustin Pop

Split out Objects.hs from QC.hs

This is the first file split out from QC.hs - an easy one, since it
has just one test.

The patch changes the way we build hpc excludes, since now we'll have
many modules that need to be excluded, and hpc doesn't seem to be able...

e4cc4c11 09/04/2012 04:50 pm Iustin Pop

Move the unittest helper to a new Test/Ganeti dir

This patch starts the move of the test haskell code from
`htools/Ganeti/HTools/' to its more proper place of
`htest/Test/Ganeti'.

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

01606931 09/04/2012 02:00 pm Iustin Pop

Implement compilation of regexes at creation time

This means that the verification of the correctness of the regex is
done once, at the deserialisation/creation time, as in the Python
code. To do this, we have to change the FilterRegex type from an alias...

4cab6703 09/04/2012 02:00 pm Iustin Pop

Rename the Qlang and Queryd modules

Per the new query module hierarchy, rename Qlang to Query/Language and
Queryd to Query/Server. This way, all query-related functionality is
now "contained" in the Query/ directory.

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

05ac718f 09/04/2012 01:59 pm Iustin Pop

Parameterize the Filter type

In preparation for introducing filtering functionality, we convert the
'Filter' type from a '*' kind to a '* -> *' kind.

This allows us to define some general properties for the filter, and
for example introduce later an easy filter compilation, etc....

2a9aff11 09/04/2012 12:44 pm René Nussbaumer

Putting the multiallocate pieces together

This is the final part:

  • Parsing the new request type
  • Feed it to allocList
  • Format the result

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

c85abf30 09/04/2012 12:44 pm René Nussbaumer

Adding allocList function

This function iterates over the tryMGAlloc function, updates the node
list and instance list, and refeeds it recursively until no new
instances are left.

This allows us then to allocate multiple instances and see if they would
fit together....

72295708 09/03/2012 04:52 pm Iustin Pop

Add missing luxi query 'QueryFields'

This was missed; we add the definition and the de-serialisation
support.

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

c12a68e2 09/03/2012 04:44 pm Iustin Pop

Improve error reporting in our JSON conversions

Reporting things such as the following in our error messages
(indentation added by me, not originally present, so it's even worse):

JSArray [JSArray [JSRational False (1 % 1),JSString
(JSONString {fromJSString = "a"})],...
adb77e3a 09/03/2012 03:13 pm Iustin Pop

Add a fillDict function

This is similar to the Python version, objects.py:FillDict.

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

14fec9a8 09/03/2012 03:13 pm Iustin Pop

Fix qualified import of Data.Map in QC.hs

As opposed to all other places in the code, we imported this as
Data.Map, leaving to longer names. Let's make it similar to the rest
of the code (import qualified Data.Map as Map).

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

998b6f8b 08/28/2012 06:32 pm Iustin Pop

Add two confd library tests

These test that we encode requests correctly and decode good messages,
that a message with a too old/new timestamp is never accepted, and
that a message signed with a different key is never accepted.

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

62377cf5 08/28/2012 06:16 pm Iustin Pop

Reduce some more code duplication and split code

The Qlang module defines ResultStatus, but it was already defined in
Ganeti/Luxi.hs; let's remove the duplicate definition from there since
the proper place is in the newer module.

Also, in order to ease testing, we split some confd functions into a...

0384c457 08/28/2012 06:04 pm Iustin Pop

Add test for checking Haskell/Python opcode equivalence

This is a very big hack for testing the equivalence of Python and
Haskell opcode definitions. See the docstring for details; I'm not
very happy with the solution but it does the job.

An alternate option would be to launch the Python code when...

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

f2f06e2e 08/28/2012 06:04 pm Iustin Pop

Handle better 'null' values in optional fields

While testing Haskell⇔Python interoperability for opcode
serialisation, I found this bug: the Haskell code doesn't treat
optional fields with 'null' values as missing, which the Python code
does, leading to differences....

9990c068 08/28/2012 06:04 pm Iustin Pop

Add test case for OpCode list equivalence

For now, we only test that we don't define extra opcodes in the
Haskell code; once we have parity, we can enable the (for now)
commented-out lines that check the reverse.

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

60f7f6a4 08/28/2012 06:04 pm Iustin Pop

Add infrastructure for reading Python command output

This will be used in the future to make tests/assertions for
Python/Haskell codebase equivalence (e.g. checking that the same
opcodes are defined, etc.).

(Side-note: this might not work in VPATH builds; I'll see how it goes)...

6dd92942 08/28/2012 06:04 pm Iustin Pop

QCHelper: add support for defining HUnit test cases

This will allow us to use exactly the same method as for defining and
using QuickCheck properties. The differentiation is based on name,
which is not very nice but is the same method used in
test-framework-th, for example (so we will be able to switch...

2c4eb054 08/28/2012 06:04 pm Iustin Pop

Rename tests for nicer names in test output

With the change to test-framework, where individual tests are listed,
QCHelper tries to remove a "prop_$group_" prefix from the function
names, for shorter names. However, some test groups (LUXI) and test
functions are not uniform, leading to long names, so we should fix...

95f6c931 08/28/2012 06:03 pm Iustin Pop

Switch Haskell test harness to test-framework

This patch replaces our home-grown, and quite limited, test runner
infrastructure with test-framework
(http://batterseapower.github.com/test-framework/). The rationale for
doing so is as follows:

- we will need to add support for HUnit tests, so either we add more...

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

Simplify the Luxi client-server test

Since now we have the recvMsgExt, we can remove the handleEOF
function.

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

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

Fix bug in the Luxi client-server test

We didn't close the server correctly, so for test sizes bigger than
the max-open-files ulimit, the tests were failing in accept().

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

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

f2374060 08/28/2012 06:02 pm Iustin Pop

Enable tags query over the query socket

This patch adds the tags field to the objects which were missing it
(all except Cluster), implements handling the LuxiCall QueryTags, and
then enables the use of the query socket in cli.ListTags, used by all
commands, and in the RAPI client....

be747966 08/28/2012 06:01 pm Iustin Pop

Change the Luxi tags kind from String to a custom type

This will allow safer code when we implement the tags query.

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

8a9ee1e9 08/28/2012 06:00 pm Iustin Pop

Remove obsolete QrViaLuxi type

The actual query definitions are now in Qlang.hs, so let's use the
ItemType from there instead of luxi-defined type (which is also
incomplete).

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

dc6a0f82 08/28/2012 06:00 pm Iustin Pop

Rename Query2.hs to Qlang.hs

While starting to use the new filter types, I realised that what is
currently implemented is the equivalent of `lib/qlang.py', not
`lib/query.py', since we only deal with data types for now and not the
actual query runtime functionality (RPC, config, etc.)....

9a94c848 08/28/2012 06:00 pm Iustin Pop

Switch Luxi Query operation to use a proper filter

Until now, since we didn't have a proper type for the encoded query
filters, we were ignoring the filters and handled them as null values
(JSNull and respectively ()). With the current Query2 implementation,...

e8a25d62 08/28/2012 06:00 pm Iustin Pop

Implement Query2 filter JSON (de)serialisation

This adds support for encoding/decoding Query2 filters to/from JSON,
in (hopefully) the same format as the Python code generates.

It also adds a simple unit-test to check that this conversion is
idempotent. Of note here is that, since the Filter data type is...

2cdaf225 08/28/2012 05:59 pm Iustin Pop

Re-enable standard hlint warnings

Commit 5a1e31b4 (Add infrastructure for, and two extra hlint rules)
was intended to add two extra hlint rules, but I didn't realise at
that time that "--hint" when first used overrides the built-in
lints. As such, since then we were basically running with just those...

7514fe92 08/28/2012 05:59 pm Iustin Pop

Add Objects definitions for the ispec/ipolicy types

Note that since we don't have yet a way to nicely handle two-level
optional parameters, the Filled/Partial types and filling function are
all manually built.

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

a957e150 08/28/2012 05:59 pm Iustin Pop

Improve Objects.hs definitions

This adds a few missing/incomplete definitions. We're still missing
the special parameters (disk params, hvparams, os_hvp).

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

84835174 08/28/2012 05:59 pm Iustin Pop

Improve the TH 'Container' type

This is the first part of the changes related to the 'Container' type.

We currently handle this type as follows: it's a simple type alias
over the Data.Map type, which means:

- it's easy to use the Data.Map functions to change the type...

66f74cae 08/28/2012 12:56 pm Agata Murawska

Simple QC tests for RPC calls

Right now we're only able to test if when a node is offline, the call
fails with an appropriate errror.

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

d4709cce 08/28/2012 12:56 pm Agata Murawska

Datatypes for haskell RPC calls

We introduce typeclasses for RPC call and result and create a typeclass
that binds the two together. For that we need to use
MultiParamTypeClasses and FunctionalDependencies language pragmas, which
allow us to ensure that RPC result type can be deduced based on the...

951accad 08/27/2012 05:18 pm Iustin Pop

Merge branch 'devel-2.6'

  • devel-2.6:
    Make stable-2.6 compatible with newer pep8
    Fix computation of disk sizes in _ComputeDiskSize
    Add verification of RPC results in _WipeDisks
    Add test for checking that all gnt-* subcommands run OK
    Fix double use of PRIORITY_OPT in gnt-node migrate...
13f2321c 08/13/2012 06:58 pm Iustin Pop

Add a server-side Luxi implementation

This is a trivial code change, but it allows us to finally test the
send-receive code on both client and server sides via a simple
in-process server.

The unittest works, but it won't handle timeouts very nicely; it will...

76b62028 08/07/2012 12:48 pm Iustin Pop

Switch job IDs to numeric

This has been a long-standing cleanup item, which we've always
refrained from doing due to the high estimated effort needed.

In reality, it turned out that after some infrastructure improvements
(the previous patches), the actual job queue-related changes are quite...

ccc817a2 07/31/2012 11:21 am Iustin Pop

Introduce a type for the ganeti job type

This will be used for easier change later.

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

2ed0e208 07/27/2012 12:16 pm Iustin Pop

Fix 'explicitely' common typo

It seems that 'explicitely' is wrong, and that the right form is
'explicitly'. This is just fixing the typo plus adjusting affected
paragraphs.

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

7803e37c 07/19/2012 03:51 pm Iustin Pop

Merge branch 'stable-2.6'

  • stable-2.6: (21 commits)
    Release Ganeti 2.6.0 rc4
    Prepare NEWS for Ganeti 2.6.0rc4
    Add some rudimentary node group ipolicy checks
    Fix setting ipolicy on node groups
    Fix --no-headers for the new list-drbd command
    Add a simple QA test for gnt-node list-drbd...
2fc5653f 07/19/2012 11:00 am Iustin Pop

Reorganise the lookup functions

Currently, the LookupResult, MatchPriority and related functions are
locate in Loader.hs, since (so far) only hbal needs them in the
selection of instances. However, with the new functionality on confd
side, we need these functions there too, but we don't want to import...

112aee5f 07/13/2012 06:00 pm Iustin Pop

Merge branch 'stable-2.6'

  • stable-2.6: (72 commits)
    Make Ganeti 2.6.0 rc3 release
    Allow reinstall even when secondaries are offline
    Prepare NEWS file for Ganeti 2.6.0 rc3
    QA updated to test instance removing when sec. is offline
    Ignore offline node errors when removing disks...
76ae2e5b 07/06/2012 04:53 pm Iustin Pop

Replace a few explicit case expressions

Since we're just talking about converting Maybe into another monad, we
can do that via the maybe function, instead of explicit casing.

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

96eccc1f 07/06/2012 04:16 pm Iustin Pop

Fix Haskell coverage results

There are two current issues with the coverage values:

- we don't import all modules, thus leading to incomplete
coverage results (too optimistic);
- we use hpc in its default mode (intersection), which means that even
modules which do have coverage results but are not used in all...

fce98abd 07/06/2012 04:16 pm Iustin Pop

Cleanup the QC.hs file w.r.t. compiler options

Currently, we build the Haskell unittests with custom GHC flags,
because we (I) were quite lazy when initially writing the
unittests. This is not a problem for the tests themselves, but it
creates problem when (for example) one would want to pass all...

2a2e2610 07/05/2012 04:09 pm Iustin Pop

hbal: return exit status 0 in case of early exit

This derives from an internal bug, but the story is consistent across
both internal and external usage of hbal.

Basically right now, hbal returns exit code 1 if requested to exit
early, even if all jobs are successful. This is counter-intuitive due...

7f119c27 06/29/2012 08:34 pm Iustin Pop

hcheck: add two simple type aliases for readability

The same types are reused a couple of times, so let's add a couple of
type aliases for easier change later and readability.

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

4b77c2a2 06/29/2012 08:34 pm Iustin Pop

hcheck: rework output mode

Looking at the output of hcheck, in human readable mode, it looks like
it always starts with a blank line. This is not nice, so I wanted to
redo this to start cleanly.

However, looking at the code, I realised that we need some internal...

85890a9d 06/29/2012 08:34 pm Iustin Pop

hcheck: reword and fix typo in instance/offline msg

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

0c76f280 06/29/2012 08:34 pm Iustin Pop

Add hlint warning for wrong use of 'length'

While removing split instances check from hcheck, I saw a wrong use of
'length': this should only be used when one needs the actual length of
the list, and not when one wants to check whether the list is empty or...

b1a9d630 06/29/2012 08:34 pm Iustin Pop

Remove can_rebalance functionality from hcheck

Since hbal can now run rebalances even in the presence of split
instances, we can remove this check and always run the rebalance.

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

cf279f03 06/28/2012 06:52 pm Iustin Pop

Correct a wrong --help option for --simulate

This was not update when the alloc policy was added to the parameter.

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

a7e1fd89 06/28/2012 06:51 pm Iustin Pop

hbal: relax restrictions on split instances

The recent patch series on hcheck made me realise how much pain we
have due to hbal not being able to work (at all) with split instances.

This is sub-optimal; ideally, hbal would degrade its behaviour, but
not completely refuse to work. This patch does this, by marking any...

81bcbbd3 06/28/2012 03:24 am Iustin Pop

Fix a few style issue in hcheck

This fixes a couple of issue I've seen while fixing the List import:

- removes over-use of printf with putStr/show
- wraps some lines
- removes superfluous parentheses in constructs like 'IO (a)'
- makes sure that in type signatures, the '->' are placed at the...

7568b296 06/28/2012 03:24 am Iustin Pop

Fix old-style import

Commit 1213f9d6 (re)added an old-style import, which fails with recent
compilers.

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

d64acbb5 06/27/2012 05:19 pm Agata Murawska

Style fix in hcheck

Signed-off-by: Agata Murawska <>
Reviewed-by: René Nussbaumer <>

3c0687b5 06/27/2012 05:19 pm Agata Murawska

Simplify stats printing

PrintGroupStats and printClusterStats had very similar code
structure. This patch abstracts those two into printStats, making it
a little more generic. Also, printStats has its arguments documented
as requested in previous patch series....

5cc97485 06/27/2012 05:19 pm Agata Murawska

Cleaner simulation of rebalance

This replaces the 'if .. then .. else ..' with a large block of code in
'else' branch by separating this code into a separate function.

Signed-off-by: Agata Murawska <>
Reviewed-by: René Nussbaumer <>

b5b19d5e 06/27/2012 05:17 pm Agata Murawska

Small reordering and renaming in hcheck

Reordered functions and shortened one function name.

Signed-off-by: Agata Murawska <>
Reviewed-by: René Nussbaumer <>