Statistics
| Branch: | Tag: | Revision:

root / test @ 339be5a8

# Date Author Comment
339be5a8 04/15/2010 06:24 pm Michael Hanselmann

utils: Add class to split string stream into lines

This will be used by the new import/export daemon to split
output by its child processes into lines.

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

d63479b5 04/12/2010 04:57 pm Iustin Pop

objects.Cluster: add method to get hv defaults

Currently the FillHV method is the one that does the cluster hvparams +
os hvparams merger. However, in some cases we need to do just this,
without adding the instance hvparams on top.

This patch adds a function to compute just this (hv + os hvp...

edf7d66e 04/09/2010 11:48 am Iustin Pop

Rename the confd_client unittest (to confd.client)

This is to keep same naming across all tests (modules separate with dot,
followed by _unittest.py).

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

cc6484c4 04/09/2010 10:57 am Iustin Pop

ConfdClient.SendRequest: allow max coverage

This patch changes the coverage parameter to allow specification of max
coverage (via -1), versus auto-computation (default, 0) and manual
specification.

Unittests are updated for this case too.

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

1b429e2a 04/07/2010 04:55 pm Iustin Pop

Fix utils.WaitForFdCondition inner retry loop

Commit dfdc4060 added WaitForFdCondition which uses utils.Retry without
handling timeout exceptions. This breaks any nested retry loops.

This patch fixes the above function, and also changes utils.Retry to
detect and warn future similar cases. In addition, we add a few small...

76e5f8b5 04/07/2010 04:15 pm Michael Hanselmann

utils: Move wrapper code around os.makedirs into separate function

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

2004e673 04/07/2010 11:55 am Iustin Pop

Fix unittest for the rapi client library

Wrong escape, so we make sure to use proper escapes (we want the
backslashes to be embedded, not interpreted). Also change " to ' to be
easier to read.

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

95ab4de9 04/06/2010 05:37 pm David Knowles

Adding RAPI client library.

Signed-off-by: David Knowles <>
Reviewed-by: Iustin Pop <>
Signed-off-by: Iustin Pop <>
(modified slightly the unittest to account for
missing httplib2 library)

e065714c 03/31/2010 06:51 pm Guido Trotter

Remove unused import from test file

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

0babc371 03/15/2010 04:39 pm Michael Hanselmann

utils.RunCmd: Test case with reset_env set and setting variables

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

1d466a4f 03/12/2010 05:44 pm Michael Hanselmann

utils.CreateBackup: Use human-readable instead of seconds since Epoch

Seconds since the Epoch are not easily readable by a human. Using a
formatted timestamp makes it easier (e.g.
“….backup-2010-03-12_14_02_43.…”). This patch also makes OS logfiles use
this formatted timestamp....

571b34f8 03/12/2010 05:44 pm Michael Hanselmann

Add unittest for daemon-util

This test doesn't cover everything, but it's better than nothing.

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

dd999b06 03/12/2010 05:44 pm Michael Hanselmann

Improve ganeti.serializer unittests

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

3bd19c66 03/12/2010 05:44 pm Michael Hanselmann

Add unittests for ganeti.errors

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

b98bf262 03/12/2010 05:44 pm Michael Hanselmann

Verify cluster certificates in LUVerifyCluster

When using pyOpenSSL 0.7 or above, LUClusterVerify will start to show a
warning 30 days before a certificate expires. 7 days before the
certificate expires, the warning becomes an error. Once expired,
LUVerifyCluster will always report an error. The latter is also supported...

27e46076 03/12/2010 05:44 pm Michael Hanselmann

utils: Add function to extract X509 cert validity

X509 uses ASN1 GENERALIZEDTIME or UTCTIME to store certificate validity.
pyOpenSSL 0.7 and above allow us to retrieve both “notBefore” and
“notAfter” as strings. Parsing them turned out to be a challenge since...

7b64b9ea 03/10/2010 04:30 pm René Nussbaumer

Adding unittests for objects.Cluster.FillHV

This adds tests for the stacking of objects.Cluster.FillHV to verify
that the override is working as expected.

Signed-off-by: René Nussbaumer <>
Reviewed-by: Michael Hanselmann <>

a8950eb7 03/10/2010 12:17 pm Michael Hanselmann

Provide unittests for http.auth

To simplify writing unittests, one data structure class in http.server is
also changed. According to the coverage utility, this provides 95%
coverage.

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

23ccba04 03/10/2010 12:17 pm Michael Hanselmann

http.auth: Fix bug with checking hashed passwords

When username and password were sent for a resource not requiring
authentication, it wouldn't be accepted if the user in question had a
hashed password. The reason was that the function GetAuthRealm used to...

b4478d34 03/08/2010 05:15 pm Michael Hanselmann

Support passing in file object in utils.FileLock

This way we can re-use file objects opened in other places. Also add more
unittests.

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

bdefe5dd 03/08/2010 05:15 pm Michael Hanselmann

Support arguments in utils.RunInSeparateProcess

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

26288e68 03/08/2010 03:53 pm Iustin Pop

Add a function to validate and normalize hostnames

This differs slightly from the specification, by allowing names to start
with digits, not checking the length of individual components, and
allowing underscores.

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

04a69a18 03/08/2010 03:53 pm Iustin Pop

ListVisibleFiles: require normalized path names

This patch changes ListVisibleFiles to raise ProgrammerError if it's
passed a non-absolute/non-normalized path name, and adds unittests for
this behaviour.

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

4bb678e9 03/08/2010 03:46 pm Iustin Pop

utils: Add a PathJoin function

This will replace os.path.join since it is not safe for directory
traversal issues.

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

72ca1dcb 02/26/2010 02:41 pm Balazs Lecz

Add multi-key support to the serializer

Signed-off-by: Balazs Lecz <>
Reviewed-by: Michael Hanselmann <>

c32b908e 02/23/2010 06:31 pm Michael Hanselmann

Add unittests for ganeti.opcodes

According to “coverage”, this covers 99% of the code.

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

6bb65e3a 02/22/2010 06:02 pm Guido Trotter

Implement utils.RunParts and use it for hooks

This function is a generic pythonic version of runparts. We currently
use it in the backend HooksRunner, but we'll use it for running
different directories as well.

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

bf4daac9 02/22/2010 06:01 pm Guido Trotter

Add reset_env option to RunCmd

This allows to run a command with only the passed in environment, rather
than just updating the default one with it.

Now with unit testing.

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

eb58f7bd 02/18/2010 02:21 pm Michael Hanselmann

Move RunInSeparateProcess to ganeti.utils

This function could be useful in other places and this
way we can easily unittest it.

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

055f822b 02/18/2010 02:21 pm Michael Hanselmann

Add function to reset tempfile module after fork

On fork, the tempfile module's pseudo random generator is
not reset. If several processes (e.g. two children or parent
and child) try to create a temporary file, they'll conflict.
This function can be used to reset the name generator which...

fabee4b2 02/15/2010 06:37 pm Michael Hanselmann

Add unittest for utils._FingerprintFile

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

d80cb8c4 01/22/2010 06:38 pm Michael Hanselmann

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Bump version to 2.1.0~rc4
    KVM: fix pylint warning
    KVM: be more resilient on broken migration answers
    Add unittests for cli.GenerateTable
    cli: Fix bug when not using headers
    daemon-util: Fix quoting issue...
2ebf1568 01/20/2010 03:47 pm Michael Hanselmann

Add unittests for cli.GenerateTable

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

f9d0783b 01/15/2010 01:23 pm Iustin Pop

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1: (22 commits)
    Fix long-standing race condition bug in locking unittest
    confd client: copy the peers in UpdatePeerList
    testutils: Print name of test program before running it
    Don't use hardcoded name for pylint...
51e3bb92 01/15/2010 12:16 pm Michael Hanselmann

Fix long-standing race condition bug in locking unittest

Every once in a while we saw failures in the locking unittest, but
weren't able to determine the cause. This patch fixes it by using
threading.Event instead of plain threading.Condition to notify another...

43983a88 01/14/2010 02:17 pm Michael Hanselmann

testutils: Print name of test program before running it

While the name can be looked up in Makefile.am, this
is useful when an automated test just hangs and needs
to be killed.

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

5b69bc7c 01/14/2010 11:26 am Iustin Pop

Add an UnescapeAndSplit function

In many cases, where we accept (usually from the command line) a list of
parameters, we remove the use of the separator as an component of any of
the elements.

This patch adds a new function that can split strings of the form...

89e2b4d2 01/13/2010 03:02 pm Michael Hanselmann

workerpool: Make worker ID alphanumeric

Having a proper name instead of just a number makes debugging
easier.

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

313b2dd4 11/30/2009 04:34 pm Michael Hanselmann

gnt-cluster verify: Warn if node time diverges too far

The warning will be generated if the clocks diverge by more
than 150 seconds. Due to the way the RPC system works, we
cannot get exact time differences, e.g. if one of the
queried nodes is broken. The comparision is done using a...

a33690c2 11/25/2009 04:40 pm Michael Hanselmann

Remove testJsonIndent unittest

It can't work on older distributions where simplejson
doesn't have indentation support.

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

ab3e6da8 11/25/2009 01:45 pm Iustin Pop

Revert "Get rid of utils.CommaJoin"

This reverts commit 6915bc28fe053e92aa16cf2d974d205f1140219c based on thread on
ganeti-devel.

Conflicts:

lib/cmdlib.py (due to the error code classification, trivial)

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

a426508d 11/20/2009 01:44 pm Michael Hanselmann

Handle EEXIST in utils.RenameFile

This should fix an issue I've seen exactly once during testing. It might have
been caused by parallel RPC calls to archive jobs.

[…] ganeti-noded:112 ERROR Error in RPC call […]
File "/usr/lib/python2.4/site-packages/ganeti/backend.py", line 2365, in JobQueueRename...

0debfb35 11/06/2009 04:08 pm Guido Trotter

config.Add{Node,Instance}: get the ec id

This is ok because adding a node or instance cannot happen in a query.

We get the ec id from the LU and pass it to _EnsureUUID, which will
then for now not use it.

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

02141fb1 11/05/2009 05:36 pm Michael Hanselmann

Cache JSON encoders and sort keys

The sort_keys argument is supported since simplejson 1.3.

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

25231ec5 11/03/2009 12:34 pm Michael Hanselmann

Ignore log messages in unittests

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

bf9bd8dd 10/29/2009 11:33 am Michael Hanselmann

http.auth: Add new function to verify passwords

This new function supports two schemes for passwords:
- Old-style cleartext passwords
- Hashed passwords according to RFC2617 (H(A1))

Schemes are differentiated by their prefix, a concept also
used in OpenLDAP. Cleartext passwords can no longer start...

a4eae71f 10/27/2009 03:14 pm Michael Hanselmann

Provide feedback from redistributing configuration

This is particularily useful for “gnt-cluster redist-conf”, but
also for all other cases where the configuration files are
rewritten on other nodes.

$ gnt-cluster redist-conf
… Copy of file /var/lib/ganeti/config.data to node … failed: Error while...

d357f531 10/19/2009 05:57 pm Michael Hanselmann

Fix serializer unittests

Commit d22b29997cd broke the serializer unittests with certain
versions of simplejson. This patch removes sort_keys again
and implements a slightly more efficient way of detecting
simplejson functionality. The serializer unittests no longer...

a6db1af2 10/15/2009 05:47 pm Michael Hanselmann

mcpu: Use new timeout class for timeout

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

23683c26 10/13/2009 08:08 pm Michael Hanselmann

Test LockSet.acquire return value for timeout

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

e3200b18 10/12/2009 01:48 pm Michael Hanselmann

mcpu: Change lock attempt timeout calculation

With this patch all timeouts are pre-calculated. The interface of
the _LockTimeoutStrategy class is also changed a bit; NextAttempt
now returns a new instance.

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

407339d0 10/12/2009 01:47 pm Michael Hanselmann

mcpu: Implement lock timeouts

The timeout is always between ~0.1 and ~10.0 seconds. A small
variation of ±5% is added to prevent different jobs from
fighting each other. After 10 attempts to acquire the locks with
a timeout, a blocking acquire is made.

Lock status reporting will be improved in a separate patch....

5aab242c 10/12/2009 01:46 pm Michael Hanselmann

locking.LockSet: Implement acquire timeouts

The timeout passed to LockSet.acquire() is measured over all lock acquires. If
LockSet.acquire fails to acquire all requested locks within the specified
amount of time, all locks are released again and the acquire fails....

6915bc28 10/09/2009 05:28 pm Guido Trotter

Get rid of utils.CommaJoin

- We never remember to use it (5 uses vs 21 " ,".join())
- It's longer to write than " ,".join()
- The added value of the apostrophe in the string is not very much

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

256eb94b 10/07/2009 12:31 pm Guido Trotter

Add case_sensitive keyword to MatchNameComponent

Now featuring unit testing, and more deterministic results on some
corner cases.

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

f1501b3f 10/02/2009 06:52 pm Michael Hanselmann

Replace all xrange() with range()

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

008b92fa 10/02/2009 03:04 pm Michael Hanselmann

More locking tests race conditions fixes

There were more race conditions. By adding a notify function to
SharedLock.acquire we can prevent them.

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

34cb5617 10/01/2009 07:47 pm Guido Trotter

SingleActionPipeCondition =~ s/Action/Notify/

With this patch we simplify usage on the SingleActionCondition (which
wasn't a condition at all) by making it a real condition. This way we
can just wait() on it, or notifyAll() as we would on a normal one. The...

b8140229 10/01/2009 07:46 pm Guido Trotter

testNotification: add more checking about order

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

c5fe2a67 10/01/2009 07:45 pm Guido Trotter

Abstract base condition test cases

This way they can be used to test different condition classes.

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

63f2e724 10/01/2009 07:45 pm Guido Trotter

Move the "done" queue inside _ThreadedTestCase

All (ok, all but one) _ThreadedTestCase users have a done Queue, so we
move its building in the _ThreadedTestCase setUp

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

a66bd91b 10/01/2009 07:35 pm Michael Hanselmann

locking.SharedLock: Fix bug in delete function

SharedLock.__acquire_unlocked uses keyword parameters. Just passing
the timeout would set the “shared” parameter.

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

5e0a6daf 10/01/2009 07:17 pm Michael Hanselmann

Rename LockSet.acquire parameter “blocking” to “timeout”

Also remove the “blocking” parameter from LockSet.remove and
GanetiLockManager.remove. There's no point in implementing timeouts on removal
unless we need them.

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

2042aa94 10/01/2009 04:59 pm Michael Hanselmann

Try to fix locking unittests

Our automated test system found a few problems in the new locking
unittests. This patch should fix them, although I wasn't able to
reproduce the problem. All are race conditions.

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

48dabc6a 09/30/2009 06:34 pm Michael Hanselmann

Add _PipeCondition class

_PipeCondition is a condition implemented using pipe(2) and poll(2).
It allows the implementation of timeouts without using a busy-wait loop
with time.sleep.

Unlike Python's built-in threading.Condition class and to save file
descriptors and an internal queue, it can only be used to notify...

d76167a5 09/30/2009 06:34 pm Michael Hanselmann

Add _SingleActionPipeCondition class

This class will be used as a basic block for pipe(2)-based
conditions. Upon initialization it creates a pipe and can be
notified once (hence the “single action” in the name). A
callable helper class is used to wait for notifications....

84e344d4 09/30/2009 06:33 pm Michael Hanselmann

SharedLock: implement timeouts

This patch greatly simplifies the SharedLock code and implements
timeouts for the acquire() and delete() functions. A wrapper around
Python's threading.Condition class must be used to ensure thread
safety when check whether there are any waiters left....

c8872a0b 09/30/2009 03:59 pm Iustin Pop

Merge remote branch 'origin/master' into mogu

  • origin/master:
    Fix burnin's verbose mode
    Final NEWS update and version increase for 2.0.4
    Encode the actual exception raised by LU execution
    Move the luxi error handling into errors.py
    Fix the confusing ssh/hostname message in node add...
74554d66 09/29/2009 01:06 pm Guido Trotter

Add initial confd client unittests

Some basic tests for the confd client library

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

59b76636 09/25/2009 03:22 pm Iustin Pop

Merge commit 'origin/next'

  • commit 'origin/next': (74 commits)
    Fix gnt-node modify online help
    Fix gnt-job info entry in gnt-job(8)
    locking: Don't swallow exceptions
    Add check for duplicate MACs in instance add
    scripts/gnt-node: fix a help string...
3a541d90 09/22/2009 05:01 pm Iustin Pop

Fix utils.MatchNameComponent for full matches

While ‘test1’ matches both ‘test1’ and ‘test1.example’, it has a full,
exact match and we should return it if that is the case.

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

28a34a39 09/16/2009 03:55 pm Guido Trotter

Add unittests for confd constants

Checking that the fourcc code is indeed a fourcc code, and that request
codes and reply statuses are distinct.

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

4d4a651d 09/11/2009 05:33 pm Michael Hanselmann

Wrap lines over 80 characters

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

e948770c 09/10/2009 07:01 pm Michael Hanselmann

Move LoadModule function to ganeti.build

It should only be used at build-time.

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

36bf7973 09/04/2009 06:11 pm Michael Hanselmann

Add simple unittest for manpages

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

bf968b7f 09/03/2009 06:45 pm Michael Hanselmann

Add simple unittest for remote API docs

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

3f991867 09/03/2009 06:44 pm Michael Hanselmann

Add simple unittest for hooks documentation

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Luca Bigliardi <>

f848ac00 08/25/2009 06:39 pm Michael Hanselmann

Run unittests in a temporary directory

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

4b5e8271 08/24/2009 03:11 pm Iustin Pop

Remove extra argument from HooksMaster class

The mcpu.py:HooksMaster class needs to have a proc attribute/argument to
init in ordet to call its LogWarning method. However, this is available
from the 'lu' attribute, so we can remove this dependency.

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

67d101d4 08/21/2009 12:35 pm Iustin Pop

Fix /proc/drbd parsing in presence of gaps

In case there are gaps in /proc/drbd related to the minors sequence,
this can lead to empty lines (see the attached data file). In this case,
we currently fail to parse the file correctly.

The patch fixes this by skipping empty lines in...

3b813dd2 08/17/2009 05:46 pm Iustin Pop

Add utils.FormatTime and a simple unittest

We don't format with subsecond-precision.

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

4e9dac14 08/07/2009 12:24 pm Guido Trotter

Serializer, remove salt_verifier functionality

The salt needs to be returned anyway, so we don't have to add another
key for the sender to recognize which request an answer is answering, so
all that infrastructure is useless. :(

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

74f37195 08/06/2009 07:13 pm Michael Hanselmann

Add constants for local disk status

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

476ce612 08/05/2009 07:40 pm Guido Trotter

TestParameterNames: also check nic parameters

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

4c14965f 08/05/2009 05:55 pm Guido Trotter

ConfigObject.ToDict() only export non-None values

The method is changed to a normal loop, to avoid calling getattr()
twice. Also getstate is changed to just use ToDict() by default.

This should also make getstate work for objects which have to
override the ToDict function because they contain other objects....

c071c5b3 07/20/2009 06:54 pm Michael Hanselmann

Fix unittests broken by commit 2bb5c9115f

File "../test/ganeti.hooks_unittest.py", line 239, in setUp
self.lu = FakeLU(FakeProc(), self.op, self.context, None)
File "…/ganeti/cmdlib.py", line 92, in init
self.LogStep = processor.LogStep
AttributeError: FakeProc instance has no attribute 'LogStep'...

529d13a4 07/16/2009 04:53 pm Guido Trotter

Add enabled hypervisors to TestConfigRunner

This parameter is now mandatory for the cluster config to work.

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

066f465d 07/16/2009 04:34 pm Guido Trotter

Get rid of the default_hypervisor slot

Currently we have both a default_hypervisor and an enabled_hypervisors
list. The former is only settable at cluster init time, while the latter
can be changed with cluster modify.

This becomes cumbersome in a few ways: at cluster init time for example...

f4a2f532 07/14/2009 01:35 pm Guido Trotter

HMAC authenticated json messages

This patch includes HMAC authenticated json messages to the serializer.
The new interface works on any json-encodable data type, and can sign it
with a private key and an optional salt. The same private key must be
used upon message loading to verify the message....

8b46606c 06/29/2009 05:26 pm Guido Trotter

check_ident_key_val, handle no_ and - prefixes

If an ident member of an IdentKeyVal relationship starts with no_ or -,
handle it the same way we do for a key. Some unittests are added to
check that check_ident_key_val behaves as expected.

This patch also changes ForceDictType to, for now, fail on such an...

4f31882e 06/29/2009 04:14 pm Guido Trotter

_SplitKeyVal with no data return an empty dict

If an empty string is passed to _SplitKeyVal, we should return {},
rather than {'': True}. Also test for the correct behavior.

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

af0413bb 06/16/2009 02:28 pm Guido Trotter

Merge branch 'next' into branch-2.1

  • next: (22 commits)
    Update NEWS and version for 2.0.1 release
    gnt-{instance,backup}(8) --nic is actually --net
    Fix a wrong function name in backend.DrbdAttachNet
    GNT-CLUSTER fix search-tags example
    Enable stripped LVs...
d019f8bd 06/15/2009 08:30 pm Iustin Pop

Fix hooks unittests after RPC result changes

Patch "Simplify the RPC result framework in backend.py" changed all
RPCs, and thus the hooks results where also changed. This needs changes
to the hooks unittests too.

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

3fb4f740 06/15/2009 08:08 pm Iustin Pop

Convert hooks_runner rpc to new style result

This also converts (and fixes) unittests and mock objects to deal with
this change, and the custom hook verifier in cmdlib.LUClusterVerify.

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

31e22135 06/15/2009 08:08 pm Iustin Pop

Remove utils.CheckDict since it's no longer used

Only the custom handling in rpc.py for call_node_info used this, so now
it can be removed.

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

c66f21a4 06/15/2009 01:52 pm Guido Trotter

config unittests: use nic params

The target test cluster should have nic params, rather than a default
bridge.

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

255e19d4 06/08/2009 07:58 pm Guido Trotter

Add NIC.CheckParameterSyntax

This function will be used to check the NIC parameters for validity.
Unittests are included.

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

17c61836 05/22/2009 06:03 pm Guido Trotter

IsNormAbsPath and users, use "normalized" term

We used to refer to normalized paths as "normal" which might be
confusing. This fixes the syntax in all current IsNormAbsPath users and
in the docstring.

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

da961187 05/22/2009 03:58 pm Guido Trotter

Add utils.IsNormAbsPath function

Currently most of the time we check for absolute path, but that doesn't
protect us from some invalid paths. In some places we should be more
strict, and this function should help us to.

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

67fc3042 05/21/2009 04:05 pm Iustin Pop

Export more instance information in hooks

Currently we miss in hooks the instance's hypervisor, hypervisor
parameters and backend parameters. This forces hooks to query back into
ganeti, which is dangerous due to possible luxi sockets exhaustion.

This patch adds these three as INSTANCE_HYPERVISOR, INSTANCE_HV_*,...