Statistics
| Branch: | Tag: | Revision:

root / test @ 0559f745

# Date Author Comment
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 <>

bfc2002f 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Update ReplaceInstanceDisks

- The RAPI client shouldn't check the replacement mode as only
the server knows which ones are valid (constants are still
provided for convenience)
- Disks shouldn't be a list of names, but of indexes

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

fde28316 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Fix behaviour of “allocatable” storage flag

When modifying a storage unit, the “allocatable” flag should default
to “no modification”. This replicates the behaviour of the command
line interface.

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

10f5ab6c 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: Encode boolean and None query values

Boolean values must be passed as 0 or 1. None should be an empty
value ("").

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

75f53ffe 05/11/2010 08:27 pm Michael Hanselmann

RAPI client: No longer check storage type locally

Only the RAPI server (actually masterd) knows which storage types
are valid. The exception can no longer be raised as the type is
only checked in the job.

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

8a019a03 05/11/2010 05:59 pm Michael Hanselmann

RAPI client: Include HTTP error code in GanetiApiError exception

Having the HTTP error code allows users of the class to act differently based
on the error code.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

de4f53e6 05/11/2010 05:58 pm Michael Hanselmann

Support different HTTP error codes in RAPI client unittest mock

This allows testing error conditions (e.g. if a job wasn't found).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

09127904 05/11/2010 05:56 pm Michael Hanselmann

RAPI client: Fix error message for unsupported methods in unittest

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

d9b67f70 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Allow waiting for job changes

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

cf9ada49 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Rename “DeleteJob” to “CancelJob”

Jobs can't be deleted, but cancelled (even though the HTTP method
“DELETE” is used).

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

cfc03c54 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Various code style changes

- Replace hardcoded values with constants
- Code formatting
- Exception messages without periods and fixed string formatting

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

752df8bb 05/11/2010 05:31 pm Michael Hanselmann

RAPI client: Add missing unittest for RepairNodeStorageUnits

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

cd577680 05/11/2010 05:29 pm Michael Hanselmann

RAPI client: Always return job ID

Even removing tags returns a job ID.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: David Knowles <>

9279e986 05/11/2010 05:27 pm Michael Hanselmann

Remove httplib2 dependency from ganeti.rapi.client

- It's possible to implement all functionality in ganeti.rapi.client
using Python's standard modules httplib and urllib2
- By doing so, proper SSL certificate verification is implemented
- Adjust some of the code to Ganeti's code style (this is not yet...

b774bb10 05/11/2010 02:01 pm Michael Hanselmann

utils.ReadFile: Add parameter to read only one line

Reading only one line is useful for reading passwords from files. This
also adds unittests for utils.ReadFile.

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

4e338533 05/10/2010 05:17 pm Michael Hanselmann

cli: Make PollJob generic to support other protocols

By separating the LUXI-specific code and stdio-related code
into separate classes, we can make cli.PollJob protocol-
agnostic, allowing it to be used with RAPI.

This patch also adds unittests for cli.PollJob....

01144827 05/10/2010 12:44 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1: (22 commits)
    NEWS: fix empty lines
    Fix a unittest name and docstring
    Force ssh to allocate a tty
    Fix a unittest docstring
    IsProcessAlive: retry stat() a few times
    Retry{Again,Timeout}: explain reraising
    utils.Retry: pass up timeout arguments...
05489142 05/10/2010 12:23 pm Guido Trotter

Fix a unittest name and docstring

The docstring has been copied by the name, but the name reports a
misspell of the function it is actually testing.

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

99729b66 05/10/2010 12:05 pm Guido Trotter

Fix a unittest docstring

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

506be7c5 05/10/2010 11:56 am Guido Trotter

utils.Retry: pass up timeout arguments

If Retry has to fail with RetryTimeout, it might be useful to pass the
Retry argument to RetryTimeout, to help debugging outside the Retry
cycle. We also define a RetryTimeout.RaiseInner() helper, to re-raise an
exception passed to RetryAgain. All served with a side of unit tests....

45cc4913 05/10/2010 11:56 am Guido Trotter

Add a few Retry unittests

Check that Retry actually times out, and actually retries.

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

f2f88abf 05/04/2010 08:13 pm David Knowles

Small fixes for RAPI client

- Always check SSL certificate for validity
- Actually JSON-encode HTTP content

Signed-off-by: David Knowles <>
Signed-off-by: Michael Hanselmann <>
Reviewed-by: Michael Hanselmann <>

3718bf6d 05/04/2010 03:38 pm Michael Hanselmann

Add optional “salt” argument to utils.{,Verify}Sha1Hmac

We're using salted hashes all over the place.

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

615aaaba 05/04/2010 03:38 pm Michael Hanselmann

Use utility functions for HMAC

HMAC will be used in more places. Centralizing some parts can't hurt.

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

24d70417 04/29/2010 04:30 pm Michael Hanselmann

Move cmdlib._VerifyCertificate to utils

This function will also be useful for inter-cluster instance
moves for verifying certificates.

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

9d198e6f 04/27/2010 05:22 pm Michael Hanselmann

Improve import/export daemon tests

- Progress messages
- Log output on errors
- Listen timeout tests

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

043f2292 04/27/2010 05:22 pm Michael Hanselmann

Retry connection in import-export daemon

Until now, exactly one attempt was made to establish a connection.
If it failed, the whole import/export for the disk in question
aborted. Retrying will make it more reliable.

Unfortunately the listening part can't be made completely...

1077f25c 04/26/2010 02:30 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1:
    masterd: Log PID, UID and GID of connected client
    qa: Use qa_utils.UploadFile to upload rapi_users file
    devel/upload: add --no-debug option

Conflicts:
lib/utils.py: Trivial

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

f93f2016 04/23/2010 06:07 pm Michael Hanselmann

masterd: Log PID, UID and GID of connected client

This can be very useful if client programs run as non-root.

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

033a1d00 04/23/2010 05:50 pm Michael Hanselmann

cmdlib: Add utility for instance data import/export

Interpreting the backend's import/export daemon status is a bit tricky.
This utility code keeps track of multiple transfers at the same time.
Users can supply callback functions to react to events.

Timeouts are currently hardcoded. Intra-cluster instance moves will likely...

6b92f2af 04/22/2010 07:12 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1:
    Add a basic unittest for uidpool.RequestUnusedUid
    Factorize LUExportInstance
    Use ints instead of strings to represent user-ids
    QA: fix reimporting instance with different name
    Fix broken commit 9e302a8
    ssh: make quiet configurable...
17f25f78 04/22/2010 06:16 pm Balazs Lecz

Add a basic unittest for uidpool.RequestUnusedUid

Signed-off-by: Balazs Lecz <>
Reviewed-by: Iustin Pop <>

a91143f1 04/22/2010 12:35 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1:
    SSH: do not check IPs
    Add separate module for backported language functionality
    Add make commit-check target
    burnin: skip migration based on hypervisor support
    Add a hypervisor constant for migration support...
cea881e5 04/21/2010 08:48 pm Michael Hanselmann

Add separate module for backported language functionality

utils.py, where they were before, is already huge.

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

fde0203b 04/21/2010 07:26 pm Michael Hanselmann

utils: Add function for partial application of function arguments

The function's code was mostly copied from Python's documentation
and it's equivalent to “functools.partial” in Python 2.5 and above.

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

debed9ae 04/21/2010 04:57 pm Michael Hanselmann

utils: Add function to read locked PID file

This is useful in combination with utils.StartDaemon and will be used for
reading the import/export daemon's PID file.

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