Statistics
| Branch: | Tag: | Revision:

root / test @ 858905fb

# Date Author Comment
858905fb 07/15/2010 05:38 pm Michael Hanselmann

Move ShellWriter class to utils

Also add unittest.

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

9dc71d5a 07/15/2010 05:37 pm Michael Hanselmann

Rename test for utils.IgnoreProcessNotFound

Usually our tests are named “Test…”.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Manuel Franceschini <>

989a8bee 07/15/2010 05:37 pm Michael Hanselmann

jqueue: Factorize code waiting for job changes

By splitting the _WaitForJobChangesHelper class into multiple smaller
classes, we gain in several places:

- Simpler code, less interaction between functions and variables
- Easy to unittest (close to 100% coverage)...

54dc4fdb 07/13/2010 11:39 pm Michael Hanselmann

Merge remote branch 'origin/devel-2.1'

  • origin/devel-2.1:
    RAPI client: Implement old instance creation request format
    rlib2: Use constants for disk and NIC parameters

Conflicts:
test/ganeti.rapi.client_unittest.py: Trivial
test/ganeti.rapi.rlib2_unittest.py: Trivial...

48436b97 07/13/2010 09:55 pm Michael Hanselmann

RAPI client: Implement old instance creation request format

Commit 8a47b4478 implemented instance creation in the RAPI client,
but it left out support for the old instance creation request format.
This patch now implements the old format as good as possible. This...

7be048f0 07/13/2010 05:26 pm Michael Hanselmann

rlib2: Use constants for disk and NIC parameters

These constants were added in commit bd061c35, but the parsing code
was not updated. This also fixes a bug where a NIC's MAC address
wasn't used.

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

926feaf1 07/12/2010 06:59 pm Manuel Franceschini

Use reserved documentation IPs and domains

Use RFC 5737 IP addresses and RFC 2606 domain names in all
unittests, docs, qa and docstrings.

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Iustin Pop <>

7b4c1cb9 07/12/2010 05:32 pm Michael Hanselmann

Provide feedback function for all LU methods

By exposing mcpu's _Feedback function (now renamed to “Log”) to LU's,
methods like ExpandNames can also write to the job execution log.

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

8a7f1c61 07/12/2010 05:27 pm Michael Hanselmann

Add function to format all job log messages

Just calling utils.SafeEncode on the log message failed when it
wasn't of the type ELOG_MESSAGE and not a string. Now non-message
log entries are formatted using repr().

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

d8bcfe21 07/12/2010 03:58 pm Manuel Franceschini

Confd IPv6 support

This patch series basically adds a new parameter 'family' to the constructors
of daemon.AsyncUDPSocket and confd.client.ConfdUDPClient. This enables the
users of these two classes to support IPv6.

In ganeti-confd.ConfdAsyncUDPClient a method to check the address families of...

a744b676 07/09/2010 04:37 pm Manuel Franceschini

Introduce lib/netutils.py

This patch moves network utility functions to a dedicated module.

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Iustin Pop <>

bd5f214b 07/08/2010 04:45 pm Apollon Oikonomopoulos

_CheckIAllocatorOrNode unit tests

Add unit tests to check the function of _CheckIAllocatorOrNode

Signed-off-by: Apollon Oikonomopoulos <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

7e5913a7 07/07/2010 05:50 pm Luca Bigliardi

Merge branch 'devel-2.1'

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Iustin Pop <>

4c32a8bd 07/07/2010 05:45 pm Luca Bigliardi

Mlockall: decrease warnings if ctypes module is not present

Node daemon prints a lot of warnings if --no-mlock option is not specified and
ctypes module is not present.

With the following patch the warning is printed only at noded startup.

Signed-off-by: Luca Bigliardi <>...

1b045f5d 07/06/2010 05:10 pm Balazs Lecz

Add utils.GetMounts()

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

9e33896b 07/06/2010 12:24 pm Luca Bigliardi

Add drbd_usermode_helper to configuration

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Iustin Pop <>

549071a0 07/06/2010 12:23 pm Luca Bigliardi

BaseDRBD: provide a way to query usermode_helper parameter

Signed-off-by: Luca Bigliardi <>
Reviewed-by: Iustin Pop <>

b8812691 07/02/2010 06:01 pm Iustin Pop

Rework the "type" system

This patch merges the _OP_REQP and _OP_DEFS class attributes into a
_OP_PARAMS list, which holds both. The associated unittest checks that
all opcode attributes are declared and checked, and that no LU uses the
old fields (could be removed later)....

2a7c3583 07/01/2010 03:13 pm Michael Hanselmann

RAPI client: Switch to pycURL

Currently the RAPI client uses the urllib2 and httplib modules from
Python's standard library. They're used with pyOpenSSL in a very fragile
way, and there are known issues when receiving large responses from a RAPI
server.
...

5a672c30 06/30/2010 02:55 pm Manuel Franceschini

DRBD IPv6 support

Support IPv6 configuration for 'drbdsetup show' parser and add unittests
concerning that case. Renames some data files to use consistent names
clarifying their usage.

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Michael Hanselmann <>

cf0e6df7 06/30/2010 02:43 pm Manuel Franceschini

IPv6 support for utils.TcpPing()

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Michael Hanselmann <>

2632795d 06/30/2010 02:32 pm Manuel Franceschini

Add function to retrieve family of an ip address

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Guido Trotter <>

c0c3fa27 06/30/2010 02:32 pm Manuel Franceschini

Introduce utils.IsValidIP{4,6}()

This patch introduces functions to check for valid IPv4 and IPv6
addresses and converts IsValidIP() to return True if it is either a IPv4
or a IPv6 address.

For now we do not change the functional behavior and replace IsValidIP...

158206e0 06/30/2010 02:17 pm Manuel Franceschini

User assertFalse instead of assert_(not ...)

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Guido Trotter <>

9769bb78 06/30/2010 01:41 pm Manuel Franceschini

Rename some constants to facilitate IPv6 support

Signed-off-by: Manuel Franceschini <>
Reviewed-by: Guido Trotter <>

1e063ccd 06/29/2010 02:30 pm Guido Trotter

AsyncTerminatedMessageStream: send_message

This function adds the ability for a AsyncTerminatedMessageStream to
have a thread-safe message delivery function.

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

37e62cb9 06/29/2010 02:30 pm Guido Trotter

AsyncTerminatedMessageStream: limit message count

Currently the message stream can process any number of messages in
parallel (if they get dispatched to different threads or processes).
In order to limit their number we only handle messages and read from...

aefbe369 06/29/2010 01:47 pm Michael Hanselmann

Add test script for cfgupgrade

This should catch cases where we update the configuration version, but
forget to adjust cfgupgrade accordingly.

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

7ed3248b 06/17/2010 08:25 pm Guido Trotter

count the number of tasks done in the wp unittest

Currently there's no way to know if something actually gets done.
After this check we actually test that the threads do their job.

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

25e557a5 06/17/2010 08:25 pm Guido Trotter

Workerpool.AddManyTasks: check tasks type

Each task has to be a sequence, or the RunTask call will fail.

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

2e37243f 06/17/2010 04:54 pm Michael Hanselmann

Change ganeti-cleaner unittest to not use random values

Using random values in unittests isn't good. This one broke exactly
when building the 2.2.0~beta0 release. I suspect there were duplicate
job IDs generated (due to $large being not so large).

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

c2a8e8ba 06/17/2010 01:00 pm Guido Trotter

WorkerPool.AddManyTasks

Useful if we want to add many tasks at once, without contention with the
previous one we added starting.

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

b5b8309d 06/15/2010 12:49 pm Guido Trotter

ListVisibleFiles: do not sort output

Among all users, turns out just one may need the output to be sorted.
All the others can cope without.

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

d51ae04c 06/14/2010 07:58 pm Michael Hanselmann

Use import/export magic for backup/import and inter-cluster moves

This should prevent bugs in our code from accidentally overwriting
disks.

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

1d3dfa29 06/14/2010 07:57 pm Michael Hanselmann

import/export daemon: Add support for a magic prefix

This “magic” value will be used to ensure that we don't accidentially
connect to the wrong daemon (e.g. due to a bug), comparable to DRBD's
per-disk secret. Just depending on the SSL certificate isn't enough...

0559f745 06/14/2010 07:56 pm Michael Hanselmann

import/export: Limit max length of socat options

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

acd65a16 06/14/2010 07:56 pm Michael Hanselmann

import/export: Validate remote host/port

The hostname and port received from the remote cluster should
be validated, just in case.

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

28f34048 06/14/2010 07:56 pm Michael Hanselmann

utils: Add function to validate service name

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

560cbec1 06/14/2010 07:55 pm Michael Hanselmann

Handle ESRCH when sending signals

Upon sending signals, ESRCH can be reported when the target no
longer exists.

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

57d56130 06/11/2010 05:06 pm Guido Trotter

ListVisibleFiles: do optional sorting

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

ca9ec5aa 06/11/2010 01:08 pm Michael Hanselmann

Improve import-export unittest a bit

- Increase timeouts from 10 to 30 seconds (this still breaks when the
machine is busy, e.g. using bonnie++)
- Depend on only one timeout per test instead of three
- Reset variables before each test

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

4dd97aa1 06/11/2010 01:08 pm Michael Hanselmann

Test client timeout for import-export daemon

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

d6547a1c 06/11/2010 01:08 pm Michael Hanselmann

Generate import-export unittest certs in parallel

Generating certificates can be slow.

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

7f890059 06/10/2010 05:45 pm Guido Trotter

_BaseCondition: allow saving/restoring state

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

1a4e32d0 06/10/2010 05:45 pm Guido Trotter

SharedLock _acquire_restore and _release_save

If a shared lock is used inside a condition, we need to make sure that
it's reacquired in the same way as it was originally, after the wait.

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

7172f605 06/10/2010 12:17 pm Michael Hanselmann

Add unittest for ganeti-cleaner

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

c08d76f5 06/08/2010 04:12 pm Michael Hanselmann

import/export daemon: Record amount of data transferred

This reports the amount of data transferred and the throughput (averaged
over 60 seconds) to the master daemon. While not yet fully implemented,
once the export scripts report the expected data size, we can even provide...

1a2e7fe9 06/08/2010 04:12 pm Michael Hanselmann

import/export: Show progress updates to user

With this patch, we show progress updates approx. once per minute.

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

f8ea4ada 06/04/2010 12:44 pm Michael Hanselmann

utils: Add function to format seconds

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

0fb44e89 06/03/2010 03:43 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    TestAsyncUDPSocket: remove dead code and add test
    TestAsyncUDPSocket: test for oversized sends
    Document the check-man change
    Update NEWS for Ganeti 2.1.3
    Second attempt at fixing check-man
    Fix check-man for newer man-db...
41a2e7d7 06/03/2010 01:56 pm Michael Hanselmann

import/export unittest: Test large(r) transfer

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

53dbf14c 06/03/2010 01:56 pm Michael Hanselmann

import/export unittest: Improve logging and fix one race condition

Apart from improved logging, one race condition is fixed. If
the destination's status file became available, the port would
be returned immediately, even if it was still “None”. Most of
the time it worked, but not always. Now an additional check...

495ba852 06/03/2010 01:48 pm Guido Trotter

daemon.AsyncAwaker

This new asyncore dispatcher can be used to force a thread running the
asyncore loop to awake from the select, by signaling it on one of its
selected sockets.

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

18215385 06/03/2010 01:48 pm Guido Trotter

Test the new streaming daemon classes

Unittests cover AsyncStreamServer and AsyncTerminatedMessageStream with
both tcp and unix sockets.

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

95ab227e 06/02/2010 08:55 pm Guido Trotter

TestAsyncUDPSocket: remove dead code and add test

- _ThreadedClient was added on the idea of making this unittest
concurrent, which was actually never done (we could test everything
without it, so well)
- handle_write() was never called without filling the send queue, and...

e9de7da4 06/02/2010 08:54 pm Guido Trotter

TestAsyncUDPSocket: test for oversized sends

Signed-off-by: Guido Trotter <>
Reviewed-by: Luca Bigliardi <>

ff18f526 06/01/2010 08:31 pm Guido Trotter

Merge remote branch 'origin/devel-2.1'

  • origin/devel-2.1:
    Explicitely return None from IgnoreSignals
    AsyncUDPSocket: fix IgnoreSignals usage and test
    Add KVM chroot feature
    Fix and Improve TryToRoman unittest

Conflicts:
test/ganeti.daemon_unittest.py...

6e7e58b4 06/01/2010 08:22 pm Guido Trotter

AsyncUDPSocket: fix IgnoreSignals usage and test

This bug was found in the asyncore master patch series, but actually
applies to 2.1 for AsyncUDPSocket as well.

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

a01b500b 06/01/2010 07:40 pm Michael Hanselmann

utils: Add function to check whether process handles a signal

This will be used to avoid a race condition between starting a program (dd
for import/export) and sending signals to it.

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

855bffd2 06/01/2010 07:40 pm Guido Trotter

Fix and Improve TryToRoman unittest

1) Don't break when the roman module is not found
2) Test that not finding the roman module doesn't make TryToRoman fail
(currently that is the case)

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

d4d1e3dd 06/01/2010 01:37 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    Convert gnt-instance list and info to use roman
    gnt-cluster info --roman
    FormatUidPool: provide optional roman conversion
    gnt-node: remove latinfriendlyfields
    Move roman conversion to compat
    Add a new opcode timestamp field...
6396164f 06/01/2010 01:22 pm Guido Trotter

Move roman conversion to compat

The new TryToRoman function provides optional easy to use roman
conversion. Nunc cum demonstrationi unitati.

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

14aeab22 06/01/2010 11:39 am Guido Trotter

Fix IgnoreSignals on socket.error

Some confusion arose handling EINTR on this function: in python 2.6
socket.error is an IOError, and thus:
- It's an EnvironmentError
- It has an .errno member

In 2.4 and 2.5 it's not, and so its errno variable must be extracted...

e3cc4c69 06/01/2010 11:34 am Guido Trotter

reraise exceptions in async tests' error handlers

This makes sure that any unforeseen error raises an exception rather
then just increasing a counter. It makes unittest debugging a lot
easier.

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

716a32cb 06/01/2010 11:34 am Guido Trotter

Move hash functions to the compat module

Since the hash functions' changed their module name between python 2.4
and 2.6, and we have to do an try/import/except trick, we'll do it just
once, for both hash functions, and in compat.py. This also fixes a use...

965d0e5b 06/01/2010 11:34 am Guido Trotter

Fix {Ignore, RetryOn}Signals on socket.error

Some confusion arose handling EINTR on those functions: in python 2.6
socket.error is an IOError, and thus:
- It's an EnvironmentError
- It has an .errno member

In 2.4 and 2.5 it's not, and so its errno variable must be extracted...

b73360e3 05/31/2010 01:02 pm Balazs Lecz

Make utils.EnsureDirs() ignore umask

EnsureDirs() should create directories with the exact mode requested
in the arguments, but it currently applies the umask.
This patch makes it independent from the umask.

Signed-off-by: Balazs Lecz <>...

bb44b1ae 05/28/2010 07:50 pm Michael Hanselmann

import/export daemon: Move command building into separate module

The import/export daemon code is already large. Moving some code
to a separate module will make it smaller and easier to test.

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

fadc3742 05/25/2010 02:30 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    Test for errors during inotify callback
    SingleFileEventHandler: Remove try/except blocks
    ErrorLoggingAsyncNotifier
    daemon.GanetiBaseAsyncoreDispatcher

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

7678409f 05/25/2010 01:16 pm Guido Trotter

Test for errors during inotify callback

- Create a new _MyErrorLoggingAsyncNotifier class which registers
error counts, rather than logging them
- Add an additional ERR notifier to test with
- Check that no error was returned, for tests that weren't supposed to...

e9c8deab 05/25/2010 01:16 pm Guido Trotter

ErrorLoggingAsyncNotifier

This mixes AsyncNotifier with GanetiBaseAsyncoreDispatcher to provide an
AsyncNotifier which will log errors, rather than bail out.

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

17931833 05/24/2010 01:12 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    TestSingleFileEventHandler: abstract notifier type
    Mainloop: handle SIGINT as well (and terminate)
    SingleFileEventHandler: update comments

Signed-off-by: Guido Trotter <>
Reviewed-by: Balazs Lecz <>

49f986e7 05/24/2010 01:00 pm Guido Trotter

TestSingleFileEventHandler: abstract notifier type

Rather than hardcode that we have two notifiers, and notifier 0 is the
terminating one, we abstract this with class level constants. This makes
it easier to add more, with different features.

The only real change is that now the callback class takes as input the...

f59dce3e 05/22/2010 09:58 am Guido Trotter

Mainloop: handle SIGINT as well (and terminate)

This is needed if daemons are in the foreground, and get ctrl+c-ed by
the user. Also add unittests to make sure the correct signals terminate
the mainloop.

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

7e3c1da6 05/21/2010 06:16 pm Michael Hanselmann

import-export daemon: Allow changing compression method

For example, exports on the same node shouldn't be compressed.

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

39019f91 05/21/2010 02:24 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    Add asyncnotifier unittests
    Make ConfdInotifyEventHandler a library function
    Comment on AsyncNotifier upstream's availability
    Remove errors.ConfdFatalError
    TestMainloop: test scheduler priorities as well
    Fix race condition in mainloop unittest...
17496050 05/21/2010 01:45 pm Guido Trotter

Add asyncnotifier unittests

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

85dbfd78 05/20/2010 05:53 pm Guido Trotter

TestMainloop: test scheduler priorities as well

By using enterabs we can schedule events at the same time, which will
then be sorted by priority.

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

19ad29d2 05/20/2010 05:52 pm Guido Trotter

Fix race condition in mainloop unittest

Currently, in testDeferredCancel if the self._CancelEvent are entered
more than 0.3 seconds after the _SendSig have been entered, the test
could fail. This is unlikely but may happen. To avoid it we use
enterabs, to use absolute times....

c6987b16 05/20/2010 05:52 pm Guido Trotter

TestMainloop.testReRun

Currently we never do that, but it's nice to know we can restart the
mainloop, after termination.

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

4db33137 05/20/2010 05:52 pm Guido Trotter

Add AsyncUDPSocket tests

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

1118ec44 05/20/2010 05:52 pm Guido Trotter

Add initial mainloop unittests

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

ebeb600f 05/18/2010 06:53 pm Michael Hanselmann

RAPI changes for instance moves

Two new resources are added:
- /2/instances/$name/prepare-export
- /2/instances/$name/export

The documentation for the existing resource for creating instances is updated
for remote imports. The RAPI client is extended for the new resources....

4a96f1d1 05/18/2010 06:53 pm Michael Hanselmann

Implement opcode changes for remote-export

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

1410fa8d 05/18/2010 06:53 pm Michael Hanselmann

Add opcode to prepare export

To prepare a remote export, the X509 key and certificate need to be generated.
A handshake value is also returned for an easier check whether both clusters
share the same cluster domain secret.

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

c6ccba7e 05/18/2010 03:40 pm Michael Hanselmann

ganeti-cleaner: Remove expired X509 certs

Importing/exporting an instance to a remote machine creates X509
certificates which expire after some time. They need to be removed from
the nodes as they become useless.

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

31ff0247 05/17/2010 02:17 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1:
    RAPI: /2/{nodes,instances}/$name should return 404 for unknown items
    ganeti-masterd: Improve error logging for client requests
    Return disk_template from LUQueryInstanceData
    RAPI client: Rename Get{Node,Instance}Info, add new GetInstanceInfo...
591e5103 05/17/2010 01:52 pm Michael Hanselmann

RAPI client: Rename Get{Node,Instance}Info, add new GetInstanceInfo

GetInstanceInfo should return the resource /2/instances/$name/info,
but so far it returns /2/instances/$name. The same applies to
GetNodeInfo, which returns /2/nodes/$name. Both names are stripped...

a3a5f850 05/17/2010 01:33 pm Iustin Pop

Add checks for master IP in cluster verify

This also updates a comment in the unittest for utils.py. We unittest
the new function for two things: correct reporting on real case (for
localhost), and correct reporting with a mocked-out TcpPing that returns...

232144d0 05/14/2010 06:46 pm Guido Trotter

utils.IgnoreSignals

Remove duplicate code between a couple of asyncore related function by
having a function in charge of handling EINTR errors. Unittests included.

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

1c54156d 05/13/2010 07:40 pm Luca Bigliardi

Merge branch 'devel-2.1'

Conflicts:
daemons/ganeti-noded
lib/daemon.py
lib/rapi/baserlib.py
lib/rapi/rlib2.py
lib/utils.py

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

8a47b447 05/13/2010 04:58 pm Michael Hanselmann

RAPI client: Implement instance creation

Currently this only supports the new instance creation request data
format version 1, but support for the old version can be easily
implemented.

Most arguments are optional and documented in the RAPI documentation....

6395cebb 05/13/2010 04:58 pm Michael Hanselmann

RAPI: Add new request data format for instance creation

As mentioned in commit d975f482d, the current way of creating an
instance via RAPI is not very flexible. With this patch, a new
instance creation request data format is introduced and documented.
Support can be detected by checking the list of features returned...

7eac4a4d 05/13/2010 04:57 pm Michael Hanselmann

Add new /2/features RAPI resource

The /2/features RAPI resource can be used to detect optional
features implemented by the RAPI server. This will be used
to recognize servers implementing a new request format for
instance creation requests.

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

4b6fa0bf 05/13/2010 04:31 pm Luca Bigliardi

Introduce Mlockall()

Add Mlockall() utility to lock current process' virtual adress space into RAM.

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

40523663 05/12/2010 02:40 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    Convert some ReadFile calls to ReadOneLineFile
    utils.ReadOneLineFile()
    Remove oneline= parameter from utils.ReadFile
    install.rst: update os version and add KVM notes
    INSTALL: update hypervisor requirements
    RAPI client: Fix SSL error reporting for real...
e587b46a 05/12/2010 02:10 pm Guido Trotter

utils.ReadOneLineFile()

Read the first non-empty file line. When strict is set, abort if more
than one line is non-empty. Some unittests inspired by the reverted ones
from commit b774bb106cc28d008e790ad2666eb64c76866fa0, and some new ones.

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

582ed043 05/12/2010 02:01 pm Guido Trotter

Remove oneline= parameter from utils.ReadFile

This partially reverts commit b774bb106cc28d008e790ad2666eb64c76866fa0.
Unittests unrelated to that particular functionality but introduced in
that commit are left untouched. Since the temporary directory is now...

5e26633b 05/11/2010 09:25 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1: (29 commits)
    RAPI client: Improve SSL error reporting
    RAPI client: Don't check node role in client
    RAPI client: Update ReplaceInstanceDisks
    RAPI client: Fix behaviour of “allocatable” storage flag
    RAPI client: Encode boolean and None query values...
1068639f 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Don't check node role in client

Only the server knows which node roles can be set via RAPI.
Constants are provided for convenience.

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