Statistics
| Branch: | Tag: | Revision:

root / src @ af8492ff

# Date Author Comment
956b83d6 02/20/2014 10:12 am Klaus Aehlig

Enforce the order restrictions on group locks

Disallow requests for an exclusive lock, if the owner already
holds a shared (and only shared) lock on a group lock that lock
belongs to.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Helga Velroyen <>

1ca6b451 02/19/2014 03:45 pm Klaus Aehlig

Efficiently verify consistent lock requests

Most requests for lock updates are consistent and mention
every lock only once. So verify this property efficiently
by comparing lengths. Only if the length do not coincide
go through the actual (quadratic) comparison to find a...

381889dc 02/19/2014 03:45 pm Klaus Aehlig

Support lock implication in allocation

Make the module abstractly handling lock allocation
honor the additional restrictions caused by lock
implications.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

80004e70 02/19/2014 03:45 pm Klaus Aehlig

Add a convenience function to free all locks of an owner

While freeing all locks of a single owner can easily be defined
out of listLocks and updateLocks, it is worth having this function
in its own right. For example, it will be needed when the death of...

75033afd 02/19/2014 03:45 pm Klaus Aehlig

Make GanetiLocks an instance of Lock

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

91e5d533 02/19/2014 03:45 pm Klaus Aehlig

Add a type class describing types that can serve as locks

Besides the lock order and Show, an additional datum is needed in order
to describe lock inclusion, used, e.g., for group locks. So add a type
class describing this property.

Signed-off-by: Klaus Aehlig <>...

c6d48e16 02/19/2014 03:45 pm Klaus Aehlig

Add missing documentation to exported function listLocks

The module Ganeti.Locking.Allocation exports the function listLocks,
hence a documentation string is required. Add it.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

e04860cc 02/19/2014 10:39 am Jose A. Lopes

Constant for instance communication network mode

Create a new constant to hold the instance communication network mode
as this constant will be necessary during the QA, and update the
general documentation about the constants related to the instance
communication mechanism....

93f1e606 02/19/2014 10:39 am Jose A. Lopes

Add '-c | --instance-communication' flag to instance modify

  • Add the instance communication flag to the 'OpInstanceSetParams'
    opcode. This flag allows the user to enable/disable instance
    communication in a running instance. This patch adds this flag but...
fc963293 02/19/2014 10:39 am Jose A. Lopes

Fix param name to conform to convention of optional params

The opcode parameters can be optional and parameters that are optional
have their names prefixed by 'pOpt'. This patch fixes with parameter
to conform to this convention.

Signed-off-by: Jose A. Lopes <>...

7a51281a 02/18/2014 04:39 pm Jose A. Lopes

Fix whitespace and typos in comments

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Hrvoje Ribicic <>

857a05fe 02/18/2014 12:30 pm Petr Pudlak

Disable deprecation warnings in PyRPC

Since on Debian Squeeze we have TH version 2.4, we need to use 'report'
instead of 'reportWarning/reportError'. However, 'report' is deprecated
in later versions, therefore we need to disable the warning.

The warning doesn't manifest on Debian Squeeze or Wheezy, but causes...

a317d77a 02/17/2014 03:40 pm Klaus Aehlig

Make the lock allocation part of WConfD's state

As WConfD is supposed to be the authoritative source for
configuration and locks, it needs to have access to the lock
state as well.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

95eb97c8 02/17/2014 03:40 pm Klaus Aehlig

Add a module for the Ganeti lock structure

Already provide a module holding the structure of the locks
available in Ganeti, so that the overall structure of WConfD
can be implemented. The actual locks still have to be added.

Signed-off-by: Klaus Aehlig <>...

3f173b09 02/17/2014 03:40 pm Klaus Aehlig

Derive Ord JobId

Make the type JobId an instance of Ord. While the order itself
does not matter, it is a prerequisite to be an instance of Ord
to be used as the type of lock owners.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

15208e95 02/17/2014 03:40 pm Klaus Aehlig

Add function describing lock updates

Add the pure part of the mechanism of updating locks. To allow
for efficient waiting on locks, return the set of owners of the locks
on which the operation is blocked.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

a1da8a50 02/17/2014 03:40 pm Klaus Aehlig

Add a function to leave the list monad

The list monad provides convenient syntax for non-deterministic
algorithms. Add a function leaving that monad with this intuition
in mind.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

c2b8d366 02/17/2014 03:40 pm Klaus Aehlig

Add data structure representing current lock status

To allow for jobs as processes, a central daemon (wconfd) will
handle allocation and release of locks. Add an appropriate data
structure to describe the current status of the locks.

Signed-off-by: Klaus Aehlig <>...

a53772a0 02/14/2014 04:57 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    Update design doc wrt to improved SSL design
    Test node certificate renewal in QA
    Use node UUID as client certificate serial number
    Revert "Temporarily remove SSL changes from NEWS file"
    Revert "Disabling client certificate usage"...
ab4b1cf2 02/14/2014 03:51 pm Helga Velroyen

Use node UUID as client certificate serial number

It turns out, that some implementations of OpenSSL are more
pedantic in checking the certficates than others. In this
particular case, the SSL connection could not be
established when the serial number of the certificates...

d5104ca4 02/14/2014 03:51 pm Helga Velroyen

Revert "Disabling client certificate usage"

This reverts commit 45f75526b848, which was introduced to
temporarily disable the implementation of SSL client
certificates. As this patch series fixes the reason for
the disabling, we are rolling back the patch....

a2a1a8ca 02/14/2014 11:47 am Petr Pudlak

Add functions for atomic operations on files

Function 'atomicUpdateFile' extends 'atomicWriteFile' that allows any
action to be run on a temporary file.

Function 'atomicUpdateLockedFile' additionally locks the original file
using flock and checks if its state conforms to the last one....

e465608f 02/14/2014 11:47 am Petr Pudlak

Add mtime/ctime to ConfigData

It's used on the Python side, it's been missing on the Haskell side.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

31daf7db 02/14/2014 11:47 am Petr Pudlak

Re-export liftIO from BasicType

This makes usage of ReaderT's liftIO more convenient.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

81959e7b 02/14/2014 11:47 am Petr Pudlak

Generate WConfD Python stubs from Haskell

The generation is included in hs2py.hs, together with other
Haskell to Python code generators.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

f952ed9f 02/14/2014 11:47 am Petr Pudlak

Generate Python stubs by inspecting functions using TH

The names of the arguments of generated Python methods are derived from
Haskell types to be as descriptive as possible.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

59881a0b 02/14/2014 11:47 am Petr Pudlak

Add the WConfD daemon itself

The daemon exposes the declared functions in Ganeti.WConfd.Core to RPC
clients (currently just 'echo').

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

fb0fa957 02/14/2014 11:47 am Petr Pudlak

Add the WConfD daemon to build configuration files

Also list it in the Haskell datatype, constants, Python constants and
test configuration.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

13f59e11 02/14/2014 11:47 am Petr Pudlak

Add a module for WConfd core functions

There are no exported functions yet, except for `echo`, which just
returns its argument back to a client.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

12121213 02/14/2014 11:47 am Petr Pudlak

Add a MonadLog instance for strict variant of RWS

This allows to log in monad stacks containing RWS.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

9515a7d2 02/14/2014 11:46 am Petr Pudlak

Add a monad for running all WConfD functions

This monad encapsulates working with the daemon and client state, as
well as failures and IO operations.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

a85aef5c 02/14/2014 11:46 am Petr Pudlak

Add a generic RPC module

The main function in this module takes a list of names of functions and
uses TH to create an RPC server, represented as a value of type Handler
(from Ganeti.UDSServer). This can be readily used to create a daemon
that dispatches RPC requests to the given functions....

f3a522ff 02/14/2014 11:46 am Petr Pudlak

Add common functions for working with TH's Type

In particular, functions for extracting types of arguments from a
function type, and for uncurrying functions with an arbitrary number of
arguments.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

f20038fd 02/14/2014 11:46 am Petr Pudlak

Another workaround for GHC linking error "unknown symbol"

This error appears after adding the dependency to lifted-base.
See also #683 and ee7caf27.

I surmise that something like this is happening: Some code, that uses
the library, is only referenced through Template Haskell. A probable bug...

d5868411 02/14/2014 11:46 am Petr Pudlak

Add instances of MonadBase and MonadControl for ResultT

This allows to use lifted operations like 'fork' or 'bracket' inside
ResultT.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

b172b0ab 02/14/2014 11:46 am Petr Pudlak

Allow clients of UDSServer to use different monads

.. as long as they're instances of "MonadBaseControl IO" and "MonadLog".
This allows the UDSServer to call functions like "fork" within monads
such as "ResultT e IO" or "ReaderT IO".

Signed-off-by: Petr Pudlak <>...

39e27230 02/13/2014 02:34 pm Jose A. Lopes

Connect new groups to the instance communication network

When a new group is added, if the instance communication network is
enabled, then this group must also be connected to this network.

  • 'LUGroupAdd._AddInstanceCommunicationNetwork' connects the newly...
d6a7518a 02/13/2014 02:33 pm Jose A. Lopes

'LUClusterSetParams' creates the instance communication net

Extend 'LUClusterSetParams' to create the user-supplied instance
communication network in case this network does not exist. Note that
if the user-supplied network already exists, nothing needs to be done...

42fda604 02/13/2014 02:33 pm Jose A. Lopes

Add 'instance_communication_network' to 'OpClusterSetParams'

... and update the unit tests.

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Helga Velroyen <>

8a5d326f 02/13/2014 02:33 pm Jose A. Lopes

Add 'instance_communication_parameter' to 'Cluster'

  • Add parameter 'instance_communication_parameter' to the Python
    'ganeti.objects.Cluster' and the Haskell 'Ganeti.Objects.Cluster'.
  • Update Haskell 'QueryClusterInfo' to return also the
    'instance_communication_network' parameter....
a987c040 02/13/2014 02:33 pm Jose A. Lopes

Fix indentation

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Helga Velroyen <>

bcb1ab78 02/12/2014 05:54 pm Petr Pudlak

Merge branch 'stable-2.11' into master

  • stable-2.11
    Update the list dependencies in INSTALL
    Make luxid's Haskell dependencies mandatory
    Fix start/stop scripts to run luxid unconditionally
    Remove the HTOOLS configuration variable
    Add a config. conditional for running Haskell coverage...
0cd5ab45 02/12/2014 05:27 pm Petr Pudlak

Remove the HTOOLS configuration variable

.. and update the code that uses it.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Helga Velroyen <>

f65784ac 02/11/2014 06:43 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    Gracefully handle queries for non-existing nodes
    Consider job-IDs queried for twice only once

Conflicts:
lib/client/gnt_node.py: trivial
src/Ganeti/Query/Query.hs: import ALL the functions

Signed-off-by: Klaus Aehlig <>...

fb8d8645 02/11/2014 05:29 pm Klaus Aehlig

Consider job-IDs queried for twice only once

As reading jobs from disk is an expensive operation, when querying
for jobs, we optimize by considering which values the job-id is asked
for in the filter. As any reasonable person would not add the same
clause twice in an Or-clause, the implicit assumption was that the...

d759a02b 02/10/2014 06:38 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    (no changes)
  • stable-2.10
    Fix 'JobIdListOnly' type from 'List' to 'Map'
    Remove NEWS entry for 2.9.4
    Workaround for monitor bug related to greeting msg
    hotplug: Verify if a command succeeded or not...
adcccd43 02/10/2014 06:24 pm Klaus Aehlig

Merge branch 'stable-2.10' into stable-2.11

  • stable-2.10
    Fix 'JobIdListOnly' type from 'List' to 'Map'
    Remove NEWS entry for 2.9.4
    Workaround for monitor bug related to greeting msg
    hotplug: Verify if a command succeeded or not
    hotplug: Call each qemu commmand with an own socat...
673425b8 02/10/2014 04:42 pm Klaus Aehlig

Merge branch 'stable-2.9' into stable-2.10

  • stable-2.9
    Revision bump for 2.9.4
    Set release date for 2.9.4
    Note UUID identification change in NEWS file
    Allow classic queries to use either names or UUIDs
    Document the change of noded's group in NEWS...
b6e31235 02/10/2014 12:44 pm Jose A. Lopes

Fix 'JobIdListOnly' type from 'List' to 'Map'

  • This patch fixes a type discrepancy between the Haskell type
    'Ganeti.OpCodes.JobIdListOnly' and the Python type predicate
    'ganeti.ht.TJobIdListOnly', the former being a list and the latter a
    dictionary....
13ef1fa5 02/07/2014 03:42 pm Hrvoje Ribicic

Allow classic queries to use either names or UUIDs

When UUIDs are used in CLI commands, such addressing of objects fails
or succeeds inconsistently across object types. Worse yet, some calls
do not fail, but simply return no result. This is due to the way the...

3062d395 02/07/2014 11:15 am Santi Raffa

luxid: give stern warnings about debug mode

Luxid as it is can leak private and secret parameters by logging
all requests as they arrive, before any preprocessing is done.

Warn the user stern warnings about this.

Signed-off-by: Santi Raffa <>...

da0aa302 02/07/2014 11:15 am Santi Raffa

OpCodes: modify InstanceReinstall for private, secret params

Modify InstanceReinstall to accept and process private and secret
parameters.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

6bce7ba2 02/07/2014 11:14 am Santi Raffa

OpCodes: modify InstanceCreate for private, secret params

Modify InstanceCreate to accept process private and secret parameters.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

07e3c124 02/07/2014 11:14 am Santi Raffa

OpCodes: modify ClusterSetParams for private parameters

Modify ClusterSetParams to accept and process private parameters.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

1a182390 02/07/2014 11:14 am Santi Raffa

OpCodes: modify InstanceSetParams for private parameters

Modify InstanceSetParams to accept and process private parameters.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

a5efec93 02/07/2014 11:14 am Santi Raffa

Add private OS parameters to cluster and instance conf

This updates objects, constructors and mocks for Instance and Cluster
objects in Python and Haskell.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

4884f187 02/07/2014 11:13 am Santi Raffa

Add Private types to Python, Haskell

This commit adds the private containers to Python and Haskell.

Signed-off-by: Santi Raffa <>
Reviewed-by: Jose A. Lopes <>

560ef132 02/07/2014 11:13 am Santi Raffa

serializer: emit and encode Private values

For inbound data the simplest, safest thing to do is to traverse all
JSON right after encoding and search for private parameters by key.

This ensures that all consumers of this data get Private values
transparently and consistently; the serializing methods don't have to...

88772d17 02/06/2014 05:14 pm Klaus Aehlig

Remove wildcard luxi operation matching in luxid

In that way, we explicitly name the operations that are not
handled by luxid and explain the reason. In particular, we
can be sure that newly added luxid operations won't be forgotten
in luxid.

Signed-off-by: Klaus Aehlig <>...

0349f9c6 02/06/2014 05:14 pm Klaus Aehlig

Implement QueryExports in luxid

...by handling as a classical query, using that queries for
export are already implemented. Note that QueryExport is slightly
different from other Query* Luxi requests, in that the fields are
not passed with the request, but have a fixed value....

015f1517 02/06/2014 03:34 pm Jose A. Lopes

Add CLI and OpCode instance communication option

  • Add command-line interface flag to enable instance communication
  • Add instance communication parameter to the opcode that creates an instance

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Michele Tartara <>

81c717cd 02/06/2014 03:34 pm Jose A. Lopes

Generate TAP names ('gnt.com.%d') for instance comm NICs

  • Add helper function that generates names of the form 'gnt.com.%d'
    which are the names for the TAP interfaces meant to be used by
    instance communication. These names are unique within the node....
3af1359f 02/06/2014 03:34 pm Jose A. Lopes

Add metadata daemon

... including, user, group, daemonizing code with command line
options, integration with the Snap HTTP server, and logic.

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Michele Tartara <>

a2dbdd82 02/06/2014 02:16 pm Klaus Aehlig

Merge branch 'stable-2.11' into master

  • stable-2.11
    Implement ChangeJobPriority in luxid
    Provide a function to change the priority of a queued job
    When enqueuing new jobs, respect job ID
    Change return type of internal rmJob
    Add a function to change the priority of a job...
155df343 02/06/2014 12:43 pm Klaus Aehlig

Change return type of internal rmJob

...to also provide the job itself. In this way, the function can
also be used for tasks that require temporarily removing a job
from the queue.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

f7743189 02/06/2014 12:43 pm Klaus Aehlig

When enqueuing new jobs, respect job ID

When adding new jobs, don't add them at the end, but at a
position that fits with their job id. In this way, we can
build operations that require fully dequeing a job an adding
it later after some modifications.

Signed-off-by: Klaus Aehlig <>...

96d55b50 02/06/2014 12:43 pm Klaus Aehlig

Provide a function to change the priority of a queued job

There is a separation of responsibilities here. For jobs still
in the queue, it is the responsibility of the queue (scheduler),
for started jobs, the job itself has to take care of it. To avoid
the job transitioning inbetween, it is temporarily dequeued during...

7711f32b 02/06/2014 12:43 pm Klaus Aehlig

Implement ChangeJobPriority in luxid

For jobs still queued, we ask the queue to change the priority,
and replicate the changed job. For jobs that have already been
started, we have to contact the job directly, which, at the moment,
means forwarding the request to masterd....

a7ab381a 02/06/2014 12:43 pm Klaus Aehlig

Add a function changing the priority of an opcode

This pure function follows the semantic that an opcode, including
its priority, may only be changed if the opcode is not finalized.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

a6b33b72 02/06/2014 12:43 pm Klaus Aehlig

Add a function to change the priority of a job

...by changing the priority of the non-finished opcodes.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

27a5367a 02/06/2014 12:43 pm Petr Pudlak

Add functions for manipulating errors in Result(T)

There is often need to manipulate these errors, for example to convert a String
from Result into an exception. These functions make this easier.

Function 'toErrorStr' lifts 'Result' to any 'MonadError'. This is useful...

e061eb16 02/06/2014 12:43 pm Petr Pudlak

Remove FromString in favor of Error from standard libraries

They have the very same functionality, and using our own FromString only
causes unnecessary code duplication.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>...

f2e06f0f 02/06/2014 12:42 pm Petr Pudlak

Add Alternative instances for GenericResult and ResultT

This allows to use Alternative specific combinators, namely `optional`.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

Cherry-pick of 78209a84b0f6be27fd381ac2...

66e40fd6 02/04/2014 04:30 pm Petr Pudlak

Catch exceptions in 'readConfig' in Ganeti.Config

.. and convert them into a "Result".
This is accomplished by using "liftIO" from ResultT.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

69bf84e1 02/04/2014 04:30 pm Petr Pudlak

Catch errors in 'lockFile' in Ganeti.Utils

Opening a file can fail as well, so catch errors there too.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

b775af80 02/04/2014 04:12 pm Klaus Aehlig

Assert correct usage of AndRestArguments fields

The special field andRestArguments is intended to be only used
as the last field of an object, catching all remaining keys.
Add a compile-time check to verify that it is used correctly.

Signed-off-by: Klaus Aehlig <>...

582bfaf6 02/04/2014 04:09 pm Jose A. Lopes

Fix whitespace

Signed-off-by: Jose A. Lopes <>
Reviewed-by: Michele Tartara <>

45907709 02/04/2014 03:14 pm Petr Pudlak

Merge branch 'stable-2.11' into master

  • stable-2.11
    Add andRestArguments to IDiskParams
    Add function providing the canonical andRestArguments
    Add genAndRestArguments :: Gen (Map String JSValue)
    Add additional constructor AndRestArguments to OptionalType...
2e09344f 02/04/2014 10:51 am Klaus Aehlig

Add andRestArguments to IDiskParams

In this way, we cann pass through the opaque parameters
required for disk creation and modification in the case of
external storage.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

4e4821bd 02/04/2014 10:51 am Klaus Aehlig

Add function providing the canonical andRestArguments

The field catching the remaining fields will always be of the same
shape, so add a function for this to make usage simple.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>

c2442429 02/04/2014 10:51 am Klaus Aehlig

Add additional constructor AndRestArguments to OptionalType

A field of this type will capture all the remaining fields
of an object as JSValues. Obviously, the intended use is
to have precisely one such field. This mechanism will allow
to pass opaque values trough, as it is, e.g., required for...

f9666f00 01/30/2014 04:11 pm Petr Pudlak

User new error handling functions in SubmitJobToDrainedQueue

This somewhat shortens and simplifies the code.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

8383b3b6 01/30/2014 04:10 pm Petr Pudlak

Use new error functions when querying locks

This helps to handle errors coming from the Luxi client.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

38e4d732 01/30/2014 04:10 pm Petr Pudlak

Use new error handling functions for querying jobs

Since we already touched getJobIDs, and this function is already based
on ResultT, use new error functions here as well.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

ea7032da 01/30/2014 04:10 pm Petr Pudlak

Update getDirJobIDs to use ResultT

Also simplify code and remove unused functions.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

fb54b24a 01/30/2014 04:10 pm Petr Pudlak

Improve liftIO of ResultT to catch IOErrors

Any IOErrors are now captured in ResultT's liftIO using try and converted into
'Bad'. This prevents IO exceptions from leaking into ResultT code and allows
them to be handled in a pure way inside ResultT's sum type....

f59cefcb 01/30/2014 04:10 pm Petr Pudlak

Rename 'resultT' to 'toError'

.. to better correspond to its generalized type.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

87f15934 01/30/2014 04:10 pm Petr Pudlak

Generalize type signatures of functions that produce Result

This allows them to be used in any 'MonadError', in particular in monad stacks
composed using ResultT, without explicit lifting.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

426f0900 01/30/2014 04:10 pm Petr Pudlak

Add withErrorLogAt which annotates and logs errors

.. and rethrows them within a MonadError. This allows to just log errors
and let them be handled elsewhere.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

565821d1 01/30/2014 04:10 pm Petr Pudlak

Add functions for manipulating errors in Result(T)

There is often need to manipulate these errors, for example to convert a String
from Result into an exception. These functions make this easier.

Function 'toErrorStr' lifts 'Result' to any 'MonadError'. This is useful...

861ddf80 01/30/2014 04:10 pm Petr Pudlak

Refactor instance MonadLog (ReaderT r m) to unify style

.. with MonadLog (ResultT e m) to be more point-free.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

d2029364 01/30/2014 04:10 pm Petr Pudlak

Add instance MonadLog for ResultT

This allows to log in monad stacks containing ResultT.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

a87a017b 01/30/2014 04:10 pm Petr Pudlak

Remove FromString in favor of Error from standard libraries

They have the very same functionality, and using our own FromString only
causes unnecessary code duplication.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

8d61946f 01/30/2014 11:03 am Petr Pudlak

Merge branch 'stable-2.11' into master

  • stable-2.11
    Make safeRenameFile create dirs with defined permissions
    Add constant for subdir permissions within the job queue
    Add utility to fix permissions
    Add data type describing permissions and possibly owners...
b9202225 01/29/2014 03:59 pm Petr Pudlak

Replace duplicated code with readJSONWithDesc

JSON errors were annotated at other places, so use the function there as
well.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

a3dabca9 01/29/2014 03:59 pm Petr Pudlak

When parsing fields, annotate JSON errors with names

This allows better debugging of failed JSON conversions.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

885dafbc 01/29/2014 03:59 pm Petr Pudlak

Add a function that enhances readJSON error messages

If an error occurs, the error message is annotated with a given textual
description of the parsed type and optionally also with the input data.

Signed-off-by: Petr Pudlak <>
Reviewed-by: Klaus Aehlig <>

0c09ecc2 01/29/2014 03:12 pm Klaus Aehlig

Make safeRenameFile create dirs with defined permissions

If, and only if, safeRenameFile creates a new directory, make sure
it has well defined permissions. While there, also optimize for the
common case. The main use of safeRenameFile is archiving jobs. As...

f23daea8 01/29/2014 03:12 pm Klaus Aehlig

Add constant for subdir permissions within the job queue

When archiving jobs, new directories have to be created, as
jobs are archived in groups of 10000. Add a constant describing
the permissions of these newly created directories.

Note that, due to the type, the constant cannot be part...

96a4ebb8 01/29/2014 03:12 pm Klaus Aehlig

Add utility to fix permissions

Especially when creating new directories, we need to make sure
ownership and permissions are set correctly. Provide a function
to do so.

Signed-off-by: Klaus Aehlig <>
Reviewed-by: Petr Pudlak <>