Statistics
| Branch: | Tag: | Revision:

root / htools / Ganeti @ 12e8358c

# Date Author Comment
12e8358c 08/28/2012 06:03 pm Iustin Pop

TH: one style fix and more docstrings

We were missing many docstrings in THH.hs, so let's add at least some
of them, and fix some unquoted '/'. Additionally one style change has
been done.

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

94518cdb 08/28/2012 06:03 pm Iustin Pop

TH: Abstract function for computing constructor names

We'll need this in another place shortly, so let's abstract it and add
proper verification of whether we were passed a type name correctly;
the previous version would have failed with a pattern match failure,...

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

4cd428db 08/28/2012 06:01 pm Iustin Pop

Config.hs: Add a function to lookup group

Like in the python code, this is a bit more complex since groups are
indexed by UUID, so we must fallback to lookup via the name (slow; but
the number of groups should be small).

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

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

Add a Functor instance for our Result type

This will allow us to use the simpler applicative form (<$>, <*>)
instead of monadic liftM, liftM2, etc.

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

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

4b71f30c 08/28/2012 06:00 pm Iustin Pop

Remove obsolete conversion function for Luxi TH

Due to the (now removed) custom filter field, we needed a conversion
function. Since now that field is gone, we can move to a simpler Luxi
TH implementation.

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

1bf11fff 08/28/2012 05:59 pm Iustin Pop

Run the query thread from confd

This enables the query functionality in confd.

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

25b54de0 08/28/2012 05:59 pm Iustin Pop

Initial query daemon implementation

This is just a new module that exports a runQueryD function, that can
be imported to run a separate thread handling the luxi requests.

Currently it needs access just to the configuration, in the future it
will need access to an RPC runner too....

0aff2293 08/28/2012 05:59 pm Iustin Pop

Enhance the Luxi interface implementation

This makes the implementation a bit nicer for both for server and
client side: we add a wrapper function with a better result type, and
a few extra functions for building the response.

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

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

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

Remove container field special cases

Since we now handle Containers uniformly, we can remove all traces of
the special handling for this field type.

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

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

Improve TH local variables naming

This patch addresses two issues with our TH code:

- using non-unique names (e.g. "std" for a local name, instead of
"std_XXXX" random names), which can leads to conflicts; on the other
hand, this makes the generated code a bit harder to parse...

02cccecd 08/28/2012 05:58 pm Iustin Pop

Expand TH with tags field

Also add this new field and the other generic fields to the cluster
object.

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

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

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

Implementation of NodeInfo call and result

node_info call takes hypervisors and vgs to ask for information about
node and returns bootid and results from hypervisors and volume groups.

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

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

Implementation of InstanceList call and result

instance_list call takes a list of hypervisors and returns a list
of running instances.

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

96dad12d 08/28/2012 12:56 pm Agata Murawska

Implementation of AllInstancesInfo call and result

all_instances_info call takes a list of hypervisors and returns a list
of (name, memory, state, vcpus, time) - one element for each
instance.

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

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

Infrastructure to execute RPC calls

Prepare and execute RPC call, prepare result for the call. These
procedures are generic in the sense that they only require the
Call and Result types to be connected.
We use curl library for sending http requests for RPC; as the library's...

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

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

Add Hypervisor and start exporting AdminState

Very simple Hypervisor object, that we want to pass in some of RPC
calls is added. We also export AdminState data type, as it is used
in one of the calls that will be implemented in this patch series.

Signed-off-by: Agata Murawska <>...

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...
5d0389dd 08/24/2012 05:55 pm Agata Murawska

More descriptive Constants.hs header

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

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

e821050d 08/13/2012 06:58 pm Iustin Pop

Switch the Luxi interface from Strings to ByteStrings

I'm doing this change for future performance optimisations. Currently
we use the Luxi interface just as a client, so not in the hot path,
but when we'll use this as a server interface, we're interested to...

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

619e89c8 07/31/2012 11:23 am Iustin Pop

htools: abstract function for parsing job ids

Both the job id and submit job result parsing are abstracted into
separate functions, so that later changes are more localised.

Also, this makes submitManyJobs itself easier to read.

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

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...
d81ec8b7 07/19/2012 11:02 am Iustin Pop

Implement a node to drbd minors query function

This can be queried remotely since it's a pure configuration query.

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

7b2ead5a 07/19/2012 11:01 am Iustin Pop

Add support for computing instance all/secondary nodes

This fixes an old FIXME. Since we now how actual DRBD configuration
data, we can finally compute the instance's secondary nodes.

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

2e12944a 07/19/2012 11:01 am Iustin Pop

Add disk logical ID support in Objects.hs

This is a complex field, so we have to do a lot of manual work for now.

The complexity arises from the fact that the contents of the field,
and the way to parse it, depends on the disk type field, so we don't
have a single, static way of parsing it. Hence we needed the...

1c7bda0a 07/19/2012 11:01 am Iustin Pop

Extend the Template Haskell loadFn model

Currently, we only allow field-by-field de-serialisation. Since we
have cases where information about how to un-serialise a field is
split across two JSON fields (e.g. disk type and disk logical_id,
hypervisor and hvparams, etc.), we need to pass the entire object to...

c2e60027 07/19/2012 11:01 am Iustin Pop

Change how customFields are built

Instead of passing an expression (which cannot come from the current
module), we pass a name, which is allowed to reference functions from
the module we're in. Since we currently don't have custom fields, we
don't need to modify any callers....

0fc8e521 07/19/2012 11:01 am Iustin Pop

Implement lookup of partial names in Config.hs

This uses the recently-moved functions to implement partial lookup of
names on getNode and getInstance, similar to the Python codebase.

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

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

ab0edd8b 07/19/2012 11:00 am Iustin Pop

Remove an unused function

This is not used, as we need a more complex serialisation, which is
done in the saveObjectField function.

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

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

b647b6d7 07/06/2012 12:11 pm Iustin Pop

Fix Query2.hs to compile without warnings

Since this is not yet used by any targets, we didn't detect yet the
compilation warnings. Just trivial exports/imports cleanup.

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

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

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

Move 'need rebalance' check from cluster check

As suggested by Rene, we should keep the check separate from printing.

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

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

Always print all variables in machine readable version

As discussed in cover letter of patch series introducing hcheck, in
machine readable version we should always print values of all variables.
When hbal simulation was not run, FINAL values are equal to INIT values....

592601b3 06/27/2012 05:17 pm Agata Murawska

Print idx <-> uuid mappings in machine readable mode

As per Iustin Pop's suggestion, we are printing group mappings
from group idx (known only to htools) to group uuid, which identifies
the group uniquely. This is required because group uuid and name
may contain characters such as '-' which are not valid parts of...

5cdbde9a 06/27/2012 05:17 pm Agata Murawska

Human readable group name improved

Instead of printing group id in human readable version of hcheck,
we now print group name.

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

92eacdd8 06/27/2012 05:17 pm Agata Murawska

Print info about ability to rebalance

As suggested during offline discussion, this patch adds a new bash
variable and description field in hcheck, which informs if the
rebalance was possible. This is to determine if there are split
instances on the cluster, in which case rebalance is impossible....

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

Improve readability for hcheck-related changes

As suggested by Rene, I added comments to types for printKeys
and printFinal. Also, realigned some lines in Hspace.

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

22b16dd0 06/25/2012 11:55 am Agata Murawska

Machine readable hcheck functionality

Machine readable output for hcheck.

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

1213f9d6 06/25/2012 11:55 am Agata Murawska

Human readable hcheck functionality

Full hcheck functionality is implemented in this patch. Hcheck runs
per-group checks, provides summary for the entire cluster and simulates
rebalance if required, the printing the modified metrics.
In this patch, only the human-readable output is available....

e6685c53 06/25/2012 11:55 am Agata Murawska

Allowing rebalance to run silently

Part of hcheck's simulation required us to silently run hbal. For that
purpose we expose iterateDepth and allow it to run silently.

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

79eef90b 06/25/2012 11:55 am Agata Murawska

Generalize functions used by both hspace and hcheck

As hspace and hcheck both use machine readable options, they require
similar functions - which are now generalized and moved to CLI and
Utils.

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

22e513e7 06/25/2012 11:50 am Agata Murawska

Initial commit for introducting hcheck tool

Introduce infrastructure required to add Hcheck and build it
successfuly.

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

232fc505 06/19/2012 11:39 am Iustin Pop

Fix corner case in quick-check generated tests

Thanks to Agata Murawska, a random seed that generates bad test cases
was found ("seed was 1768143307 2118231514, test size 74"). This is
due to the fact that some nodes were generated with tMem=0, fMem=0,
which means that pMem was NaN and thus the node was not comparing...

c664f05e 06/14/2012 07:15 pm Guido Trotter

Add query2 numeric comparison operators

These were recently added to the python version.

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

ac13f473 06/12/2012 04:55 pm Guido Trotter

Haskell data types for query2

This contains the types to express query2 queries, filters and results.

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

c5b4a186 06/08/2012 02:02 pm Iustin Pop

Fix prefix bug in Haskell ssconf implementation

This patch fixes a (brown-bag) bug in the ssconf implementation where
the looked-for filenames were not prefixed with the ssconf file
prefix.

Additionally, a test for this is added (which fails without the fix)....

36691f08 05/29/2012 12:09 pm Iustin Pop

Add support for SIGHUP handling in Haskell daemons

This patch adds support for handling SIGHUP and reopening the
stdout/stderr logfile in daemon mode (but not in foreground mode).

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

0c28bee1 05/29/2012 12:09 pm Iustin Pop

Rework logging setup for Haskell daemons

This fixes a missing functionality: closing of stdout/stderr when
forking daemons. Without this, starting the daemons from the command
line seems to work, but doing it from utils.RunCmd breaks, since
without closing the standard descriptors, RunCmd never finishes....

cdd495ae 05/08/2012 01:37 pm Iustin Pop

Add decoding of Luxi calls and unittests for LuxiOp

This patch adds a hand-coded decoder for LuxiCall arguments, as the
data-structure is not uniform enough for automated generation (even
for the serialisation, we had to add hints for some fields,
de-serialisation is even harder)....

5cefb2b2 05/08/2012 01:37 pm Iustin Pop

Some unit tests improvements

In preparation for unit-testing the Luxi definitions, this improves
the auto-generation of OpCodes: currently this uses unbounded plain
Strings for names and fields, and this creates too big test sizes
(e.g. when automatically generating job sets)....

95d0d502 05/08/2012 01:37 pm Iustin Pop

Auto-define a LuxiReq data type

We currently auto-generate a LuxiOp data type, which holds the entire
operation (including parameters). However, having a data type just for
the method call would be useful, so let's change THH to also
defineSADT for the Luxi constructors....

fae980e5 05/08/2012 01:37 pm Iustin Pop

Replace hardcoded constants with Constants.hs names

Now that luxi.py constants are exported, we can use them for more
consistency.

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

3ad57194 05/08/2012 01:37 pm Iustin Pop

Add a new JSON function

And its associated unittests.

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

79ac58fa 05/01/2012 08:11 pm Iustin Pop

Further fixes for new-style exception handling

Commit 30d25dd8 moved the htools code to new-style exception handling,
but the hconfd code hasn't been, which fails when compiling on newer
GHC versions.

This patch does the rest of the move; however, the situation is not...

30d25dd8 03/26/2012 11:54 am Iustin Pop

Switch to new-style exception handling

Currently, we're using Prelude.catch to handle I/O errors in
htools. This style of error handling has been deprecated for a while,
but it still used to work without warnings.

However, the GHC release 7.4 has started to emit deprecation warnings...

d80e3485 03/26/2012 11:54 am Iustin Pop

Change a type computation for compatibility with 6.12

This is the last warning related to TemplateHaskell that was 6.12
specific; for some reason, it doesn't "see" that traw/tname were used.

The patch just replaces the quoting syntax with an explicit type...

ffbd9592 03/26/2012 11:53 am Iustin Pop

Fix compatibility with TemplateHaskell from GHC 7.4

GHC 7.4 has updated the TemplateHaskell library, and it turns out that
the way we built the JSON instance implementation for showJSON was not
good (probably this is why GHC 6.12 was generating some warnings)....

88a10df5 03/22/2012 07:30 pm Iustin Pop

Rework exit model

While updating the confd code, I realised that we have lots of
duplication in the exit model for the various programs.

So this patch attempts to abstract all the exits via a couple of new
functions; sorry for the somewhat big patch, but I hope the payoff is...

b714ff89 03/22/2012 03:58 pm Iustin Pop

Add command line option for controlling syslog use

… and enable it in hconfd.

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

a6e2a138 03/22/2012 03:58 pm Iustin Pop

Add support for syslog logging to Ganeti.Logging

Currently this is initialised to no from Daemon.hs, but will in the
future allow command-line options for controlling it.

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

f183de56 03/21/2012 12:37 pm Iustin Pop

Allow hail to read data from stdin

This patch makes hail treat '-' as denoting stdin, per the usual Unix
convention. This will help with testing.

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

19cff311 03/21/2012 12:37 am Iustin Pop

Update hconfd bind address handling

Instead of hardcoded IPv4 INADDR_ANY, this patch changes hconfd to use
either the any network for the configured cluster address family
(ipv4/ipv6), or whatever the user passes in via the --bind option.

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

aa3adf35 03/21/2012 12:25 am Iustin Pop

Add skeleton ssconf module

This currently has only one export function in it, which will be used
for future bind address functionality in daemons.

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

1091021c 03/21/2012 12:25 am Iustin Pop

Add two utility functions

These both are work with/on the Result type, so we add them to
BasicTypes. The functions will be used as more generic versions of
some more specialised functions that are right now spread across the
modules.

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

152e05e1 03/21/2012 12:25 am Iustin Pop

Add the bind-address option

This implements the same logic as the Python code: if the option is
not used, use the default appropriate for the cluster, otherwise try
to parse and use whatever was passed in.

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

e6812a1a 03/19/2012 12:00 pm Iustin Pop

htools: fix long version of --port for daemons

The dashes do not need to be in, if they are then the resulting option
is:

-p PORT  ----port=PORT     Network port (default: 1814)

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