Statistics
| Branch: | Tag: | Revision:

root @ 29a30533

# Date Author Comment
29a30533 11/12/2012 01:21 pm Iustin Pop

Remove unsafePerformIO usage

We need to change a few things, most importantly CLI options defaults,
but otherwise we already used the path to files from functions which
were already in the I/O monad, so we don't have to change much of the
code flow.

Additionally, Path.hs now has an explicit export list, to stop...

37904802 11/12/2012 01:21 pm Iustin Pop

Change keyToFilename/readSSconfFile interaction

Currently, keyToFilename uses itself the default config path. In the
light of making that an function in the IO monad, let's remove the
"default" path functionality from this function and make it always
require the config path; its caller, readSSConfFile, can then do the...

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

48483a2e 11/12/2012 12:02 pm Iustin Pop

Two small logging improvements

The "starting" message is changed to match the Python one, and in case
the preparation fails, we also log the error (beside printing it on
stderr or writing it to the error reporting pipe), as at this time
logging is usually set up....

73b16ca1 11/12/2012 12:02 pm Iustin Pop

Annotate confd startup/luxi binding error

The luxi binding is now annotated for better readability.

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

e14b84e9 11/12/2012 12:02 pm Iustin Pop

Switch writing of PID file to new reporting style

Currently, the writing of the PID file uses a "standard" error
reporting: catch exception, transform it into a 'Result' type, leave
handling of that to the caller. However, for daemon startup, we
actually want exceptions to be propagated up until the handler which...

7413b229 11/12/2012 12:02 pm Iustin Pop

Move and rename BasicTypes.annotateIOError

It turns out that annotateIOError already exists in the standard
library, with a different purpose (this made me waste 10 minutes
trying to understand why the types were wrong…). Let's move this out
of BasicTypes, since it's used only in Daemon.hs, and also rename it....

b9097468 11/12/2012 12:02 pm Iustin Pop

Switch daemon startup to pipe-based error reporting

This changes the daemon reporting error to the same mechanism as in
Python: use a pipe which is written to from the forked children.

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

ef3de7b0 11/12/2012 12:02 pm Iustin Pop

Move preparation steps of confd in prepMain

This does the address parsing earlier, before we fork, for
better/faster error reporting.

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

4c3f55b8 11/12/2012 12:02 pm Iustin Pop

Split queryd run into prepare and exec

This will help with the general daemon split of prepare/run, and flag
errors earlier in the startup.

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

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 "instance1.example.com"), or (TagInstance, Nothing)....

88609f00 11/12/2012 11:44 am Iustin Pop

Switch Luxi TH code from simple to custom fields

This is needed so that we have more flexibility in generating Luxi
serialisation code (deserialisation is still custom). Also, only
exceptions are now using the 'simple' field types, so we might be able
later to convert and remove that TH code as well....

a309a3b4 11/12/2012 11:44 am Iustin Pop

Fix display of results in ==? operator

Doh, this is exactly the opposite of what we wanted… good thing no
test failed so far :)

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

92ad1f44 11/12/2012 11:44 am Iustin Pop

Make THH:genSaveOpCode a bit more general

This can be improved, by taking all hardcoded names as parameters, to
serve as a more-general "build save clause for a multi-constructor
data type". I'm not renaming the function as well, since I don't know
exactly how much we can abstract later....

a12f0ef8 11/09/2012 03:35 pm Michael Hanselmann

sphinx_ext: Allow use of “rapi” module in pyeval

This way constants like “rapi.RAPI_ACCESS_WRITE” can be used in
documentation.

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

2a38e913 11/08/2012 08:37 pm Michael Hanselmann

rlib2: Document two previously undocumented functions

Commit 208a6cff just included empty docstrings.

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

e4e59de8 11/08/2012 04:40 pm Michael Hanselmann

jqueue/mcpu: Determine priority using callback

Instead of being given the priority for acquiring locks by means of a
parameter, mcpu will now call back. This is in preparation for
implementing a command to change a job's priority on the fly and allows
to change it while locks are being acquired (taking effect on the next...

8af734f8 11/08/2012 04:15 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    http/__init__.py: Remove extraneous argument
    rapi.testutils: Add utility to format HTTP headers
    rapi.testutils: Return headers from mock utility
    http: Add wrapper for mimetools.Message
    Add missing tests for commit f0d2286...
22105827 11/08/2012 04:08 pm Michael Hanselmann

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    http/__init__.py: Remove extraneous argument
    rapi.testutils: Add utility to format HTTP headers
    rapi.testutils: Return headers from mock utility
    http: Add wrapper for mimetools.Message
    Add missing tests for commit f0d2286...
e080072c 11/08/2012 03:53 pm Michael Hanselmann

http/__init__.py: Remove extraneous argument

pylint complained, I fixed it, and unfortunately pushed too early.

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

1b8e72f3 11/08/2012 03:20 pm Michael Hanselmann

rapi.testutils: Add utility to format HTTP headers

Once again this will be used by forthcoming RAPI test.

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

0351944b 11/08/2012 03:20 pm Michael Hanselmann

rapi.testutils: Return headers from mock utility

A newly added test for RAPI will also verify the returned headers. A
test in ganeti.rapi.client_unittest.py is split into smaller stand-alone
tests.

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

0e632cbd 11/08/2012 03:19 pm Michael Hanselmann

http: Add wrapper for mimetools.Message

A newly added piece of code will also have to parse headers, so having
this wrapper saves us from copying this part of code.

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

cdc2392b 11/08/2012 02:58 pm Iustin Pop

Rename Confd.hs to Confd/Types.hs

This should be the last module rename, promise!

We rename this to conform to the other hierarchies (e.g. Query), and
to not have both Confd.hs and Confd/*.hs.

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

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

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

7a70541e 11/07/2012 06:57 pm Michael Hanselmann

Add missing tests for commit f0d2286

Commit f0d2286 changed the logic of
gnt_instance._ConvertNicDiskModifications to also allow a parameter
named “modify”. Unfortunately the corresponding unittest was not
updated. An “if”/“else” condition is also merged....

2ac2e420 11/07/2012 05:58 pm Iustin Pop

Implement base checkFn/prepFn/execFn model for daemons

This mirrors the code in the Python code base, and is required for
clean error reporting during startup.

This patch implements the basic infrastructure; the confd daemon is
not yet modified to take advantage of this, just the types are...

7ae5d703 11/07/2012 03:39 pm Iustin Pop

One more ghc 7.6 fix

This is only in master, so needed to be fixed separately.

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

c258f110 11/07/2012 03:35 pm Michael Hanselmann

workerpool: Use itertools.count instead of manual counting

Instead of having to explicitely increment the value (“… += 1”), a call
to next() is enough. These numbers should in no case be re-used (they
are used for ordering tasks). Using “itertools.count” is useful here as...

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

f9435bdc 11/07/2012 02:07 pm Iustin Pop

Switch devel/upload to a static file

We had twice in the past days questions about devel/upload being
"broken", since bash re-reads shell scripts during their run and this
file can get regenerated due to Makefile changes.

Since we only need this to be dynamically built for 3 variables, let's...

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

f215debf 11/06/2012 08:01 pm Guido Trotter

Use SSH_LOGIN_USER rather than root for xl ssh

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

1f5557ca 11/06/2012 08:01 pm Guido Trotter

Fix gnt-instance console with xl

- Rename xm-console-wrapper to xen-console-wrapper
- Pass the xen command to use as a parameter

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

10b86782 11/06/2012 07:59 pm Michael Hanselmann

Add utility to check if file is executable

This replaces direct calls to “os.access” and
“os.path.exists”/“os.path.isfile”.

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

55d1ebfa 11/06/2012 07:27 pm Michael Hanselmann

Fix NameError in constants.py introduced in merge 46c1f82

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

471b6c46 11/06/2012 06:48 pm Iustin Pop

Add test for Luxi calls consistency hs/py

This tests that the same Luxi calls are defined in Python and
Haskell. It doesn't test yet that their serialisation is correct
though.

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

46c1f828 11/06/2012 06:26 pm Guido Trotter

Merge branch 'devel-2.6'

  • devel-2.6:
    Disable E1101 on ganeti/http/server.py:424
    Fix live migration under xl
    Don't check for xend port when using xl

Conflicts:
lib/hypervisor/hv_xen.py: trivial

Signed-off-by: Guido Trotter <>...

16c2024a 11/06/2012 06:20 pm Guido Trotter

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    Disable E1101 on ganeti/http/server.py:424
    Fix live migration under xl
    Don't check for xend port when using xl

Signed-off-by: Guido Trotter <>
Reviewed-by: Bernardo Dal Seno <>...

57a6042e 11/06/2012 05:47 pm Guido Trotter

Disable E1101 on ganeti/http/server.py:424

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

053c356a 11/06/2012 04:32 pm Guido Trotter

Fix live migration under xl

Until now the only way to make live migration work in conjunction with
"xl" was to add ssh known_hosts keys for every node's secondary ip on
every other node.

With this command we remove the target key verification: this is not...

3135de69 11/06/2012 04:32 pm Guido Trotter

Don't check for xend port when using xl

If the toolstack is set to "xl" we shouldn't ping xend for liveness
before attempting a live migration.

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

2826897c 11/06/2012 04:00 pm Michael Hanselmann

utils.io: Improve handling of double and single slashes

Up until now “IsBelowDir("/", …)” would never return True. The reason
was that an additional slash was added to the root path resulting in
“//", which is “implementation-defined” in posix and treated specially...

f94779f5 11/06/2012 03:56 pm Michael Hanselmann

workerpool: Don't mask variable in AddManyTasks

The name “priority” is already used.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

c69c45a7 11/06/2012 03:56 pm Michael Hanselmann

workerpool: Simplify _WaitForTaskUnlocked

The function in is simplified in its structure and duplicated checks
have been merged.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

bcd35e09 11/05/2012 09:50 pm Dato Simó

cli.py: use None as name for tag operations on the cluster

This change is mostly cosmetic. Previously, the literal "cluster" was
used for the 'name' field of tag operations on the cluster (as opposed
to a node or an instance). Since this field has a type of TMaybeString...

c17770c7 11/02/2012 01:25 pm Bernardo Dal Seno

Fix previous merge

A call to _CalculateGroupIPolicy wasn't refactored during the merge.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Michael Hanselmann <>

8e09e801 11/01/2012 07:44 pm Michael Hanselmann

Merge branch 'devel-2.6'

  • devel-2.6:
    Fix typo in gnt-instance man page
    jqueue: Return jobs to queue when shutting down
    gnt-debug delay: Add "--submit" option
    Make hostname checks uniform between instance rename and add
    Improve logging of new job submissions...
dc2cc657 11/01/2012 06:39 pm Michael Hanselmann

Merge branch 'stable-2.6' into devel-2.6

  • stable-2.6:
    Fix typo in gnt-instance man page
    jqueue: Return jobs to queue when shutting down
    gnt-debug delay: Add "--submit" option
    Make hostname checks uniform between instance rename and add
    Improve logging of new job submissions...
88f622e0 11/01/2012 05:48 pm Michael Hanselmann

Fix typo in gnt-instance man page

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

942e2262 11/01/2012 05:48 pm Michael Hanselmann

jqueue: Return jobs to queue when shutting down

When a job is still waiting for locks and the queue is shutting down,
they should be returned and not actually start processing. Until now
jobs which transitioned from “queued” to “waiting” were already
considered to be running as far as the shutdown code was concerned....

bb600388 11/01/2012 05:09 pm Michael Hanselmann

gnt-debug delay: Add "--submit" option

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

b1adc12e 11/01/2012 05:06 pm Michael Hanselmann

Remove duplicate workerpool test

Commit 52c47e4e (July 2010) added the exact test twice, probably due to
a copy & paste error.

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

233f4bc6 11/01/2012 03:00 pm Iustin Pop

Make hostname checks uniform between instance rename and add

Currently, we have instance rename doing extra checks on the host
name, to prevent accidental wrong renames; however, instance create
doesn't do these checks (issue 291), which (if DNS is misconfigured)...

4c91d2ad 11/01/2012 03:00 pm Iustin Pop

Improve logging of new job submissions

This addresses issue 290: when receiving new jobs, logging is
incomplete, and we don't have the job ID and/or summaries
logged. Only later, when the job is queried for or being processed, we
know more.

This is not good when troubleshooting, so let's improve the initial...

a9d40c65 11/01/2012 03:00 pm Iustin Pop

Improve handling of lock exceptions

There are two issues with lock exceptions right now:

- first, we don't log the original error; this is fine for now
(locking.py always returns the same error here), but in general is
brittle: if locking.py would start returning more information, we'd...

cfa2b7a0 10/30/2012 09:00 pm Iustin Pop

Add note about developing on a production machine

This is the bit of documentation missing for issue 170. Doing
development on a machine which already has Ganeti installed kind of
works, but only when the installed and the developed version are very
similar, and even then it can be problematic....

0d324688 10/30/2012 04:07 pm Iustin Pop

Fix runtime memory increases

Commit 2c0af7da which added the runtime memory changes functionality
had a small typo (wrong name); I've rewritten this to only compute the
delta once, for simplicity.

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

8e66b9bf 10/30/2012 02:17 pm Iustin Pop

Fix validation of vgname in OpClusterSetParams

This variable can be empty, when we want to disable LVM, so we can't
use TMaybeString.

Fixes issue 285.

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

e5dfc531 10/30/2012 02:17 pm Iustin Pop

Fix removal of storage directory on shared file storage

This patch makes _RemoveDisks symmetric to _CreateDisks with respect
to file-based storage: _CreateDisks uses "in constants.DTS_FILEBASED",
whereas _RemoveDisks was not update and only uses "==
constants.DT_FILE". This results in stale directories left on the...

15361a18 10/30/2012 02:17 pm Iustin Pop

Switch non-redundant check to disk template-based

Currently, the warning/notice about non-redundant instances in cluster
verify is based non empty secondaries list (how old is this?); the
proper way to check this nowadays is via DTS_MIRRORED.

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

efd38c3d 10/30/2012 12:59 am Bernardo Dal Seno

Fix permission for socket directory

The directory must we writable also by the confd daemon user.

Signed-off-by: Bernardo Dal Seno <>
Reviewed-by: Iustin Pop <>

dc1e9a74 10/29/2012 02:19 pm Iustin Pop

Document the new --yes-do-it option for master-failover

Sorry, this should have gone in the previous commit, I forgot about
it.

Signed-off-by: Iustin Pop <>
Reviewed-by: Bernardo Dal Seno <>

6022a419 10/29/2012 01:59 pm Iustin Pop

Add option to force master-failover without voting

This fixes issue 282.

Signed-off-by: Iustin Pop <>
Reviewed-by: Bernardo Dal Seno <>

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

7939f60c 10/26/2012 05:35 pm Michael Hanselmann

cfgupgrade: Write file for file storage paths

When file storage is used this file is now mandatory.

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

5e09a309 10/26/2012 05:35 pm Michael Hanselmann

backend: Switch to new file storage directory verification

The configuration is no longer used for verifying file storage paths.

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

72b35807 10/26/2012 05:35 pm Michael Hanselmann

Check allowed file storage paths during cluster-verify

Some paths, such as /bin or /usr/lib, should not be used for file
storage. This patch implements a check during cluster verification to
fail in case such a path has been used.

Signed-off-by: Michael Hanselmann <>...

78062de9 10/26/2012 05:33 pm Michael Hanselmann

Make Paramiko an optional dependency for listrunner

With the move away from “setup-ssh”, Paramiko is no longer necessary to
configure SSH on nodes.

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

8a670753 10/26/2012 05:27 pm Michael Hanselmann

Remove setup-ssh

It has been superseeded by “prepare-node-join”.

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

224ff0f7 10/26/2012 05:27 pm Michael Hanselmann

gnt-node add: Use prepare-node-join

This patch changes “gnt-node add” to use the newly added
“prepare-node-join” tool. Hereby Paramiko is no longer a hard dependency
for setting up SSH on nodes.

In “gnt_cluster.py”, a positional parameter is no longer passed as a...

f712208d 10/26/2012 05:27 pm Michael Hanselmann

prepare-node-join: Use ssh.GetAllUserFiles

Instead of building the dictionary locally, the global version in
“ssh.py” can be used.

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

5484cda5 10/26/2012 05:27 pm Michael Hanselmann

ssh: Add function to get all of user's SSH files

This new function returns the file paths for all of a user's SSH-related
files (RSA, DSA and authorized_keys).

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

d5d76ab2 10/26/2012 05:27 pm Michael Hanselmann

RunCmd: Support standard input file descriptor

This patch changes “utils.RunCmd” to accept a file-like object or a
numeric file descriptor which will be used as the command's standard
input. One use-case will be to pass all necessary data to
“prepare-node-join”....

feec4cc5 10/26/2012 03:37 pm Michael Hanselmann

Factorize job selection in “gnt-job cancel”

This will also be used for changing jobs' priorities. All parameters to
the common function are non-optional.

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

6b96df59 10/26/2012 03:37 pm Michael Hanselmann

utils.x509: Factorize code to extract X509 certificate

This will be useful in “gnt-node add”.

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

ebae9e37 10/26/2012 03:37 pm Michael Hanselmann

prepare_node_join: Move daemon SSH files to constants

This dictionary will also be useful in “gnt-node add”.

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

340ae7da 10/26/2012 03:37 pm Michael Hanselmann

prepare-node-join: Swap private and public keys

Other places, such as “ssh.GetUserFiles”, use a structure where the
private key comes before the private key. Until now prepare-node-join
did the opposite, that is the public key came first. To avoid confusion...

910ef222 10/26/2012 03:37 pm Michael Hanselmann

prepare-node-join: Use public key directly for auth…_keys

A public key already includes the necessary prefix (“ssh-rsa” or
“ssh-dss”), so there is no need to add it again.

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

7bd70e6b 10/26/2012 03:35 pm Michael Hanselmann

ssh.GetUserFiles: Parameter to disable directory check

Without this parameter, either an error would be raised or “.ssh” would
have to be created. Now it is possible to retrieve the paths without
requiring the “.ssh” directory to exist.

Signed-off-by: Michael Hanselmann <>...

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

5c03bcea 10/26/2012 02:49 pm Iustin Pop

Fix lint issue in Test/…/THH.hs

Sorry!

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

bca39f5c 10/26/2012 02:23 pm Iustin Pop

Fix X509CertError definition in Haskell codebase

Thanks Dato for catching this.

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

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

f51eacf3 10/26/2012 02:22 pm Iustin Pop

Add a simple unittest for THH code

This is very THH specific, and applies to all serialisations generated
by THH, so I'm adding it in its own module.

Probably we should add some more generic tests, but in general THH
code is tested by the various definitions; this new field type however...

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

d976957d 10/26/2012 11:06 am Iustin Pop

Update instance modify message

Currently the message does not say explicitly that instance-initiated
reboots are useless to trigger the use of new parameters, per the
thread on the user mailing list. Let's improve it a bit.

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

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.

Also:

- errors.py: update OpPrereqError's docstring to note that an error
code is always expected as the second argument (it was previously...
cd93a0ec 10/25/2012 06:47 pm Iustin Pop

Remove unused cache implementation

Note that this commit has no Makefile.am changes, as the files were
not actually used. So it's better to actually remove them.

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

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

5e360222 10/25/2012 04:46 pm Michele Tartara

Fix two typos in Ganeti administrator's guide

Fix a verb tense and add a missing verb.

Signed-off-by: Michele Tartara <>
Reviewed-by: Adeodato Simo <>

15c118a4 10/25/2012 04:10 pm Michael Hanselmann

bdev: Remove unused import of itertools

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michele Tartara <>

23e3c9b7 10/25/2012 03:18 pm Michael Hanselmann

bdev: Add verification for file storage paths

An earlier version of this patch series verified all paths in cmdlib in
the master daemon. With this change all that verification code is moved
to bdev to run inside the node daemon. The checks are much stricter...

aebd0e4e 10/25/2012 03:16 pm Michael Hanselmann

jqueue: Factorize code to modify job

A new function will be added to change a job's priority.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

552328b8 10/25/2012 03:16 pm Michael Hanselmann

cli: Use callback for --priority

If the option is used elsewhere, the numeric value is directly
available.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

bb921668 10/25/2012 03:16 pm Michael Hanselmann

jqueue: Add docstring for _DetermineJobDirectories

Somehow this was missed in commit 0422250e.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

42d49574 10/25/2012 03:16 pm Michael Hanselmann

jqueue: Fix comments in _SubmitJobUnlocked

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

c87440f5 10/25/2012 03:16 pm Michael Hanselmann

Drop SSHS_FORCE constant

It is not actually used.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>