Statistics
| Branch: | Tag: | Revision:

root / lib @ 1afea34a

# Date Author Comment
1afea34a 06/22/2010 02:25 pm Apollon Oikonomopoulos

Add "adopt" to the allowed disk parameters

"adopt" was missing from bd061c3, thus breaking disk adoption.

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

c04bc777 06/22/2010 02:17 pm Iustin Pop

Fix warnings with Python 2.6

'format' is a new built-in function, and 'bytes' is a new builtin type.
We rename this to make pylint happy (and remove potential bugs).

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

035f40fc 06/22/2010 12:25 pm Iustin Pop

Fix a small bug introduced in cf26a87a

Commit cf26a87a added a tiny typo, which would break non-FQDN arguments
to modify node storage.

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

e88fc57d 06/22/2010 12:23 pm Iustin Pop

Fix the type of 'valid' attribute in LUDiagnoseOS

The update of the valid status in LUDiagnoseOS says:

valid = valid and osl and osl[0][1]

However, in Python, “True and []” (which '[]' we get for an invalid OS)
will result in “[]”, and thus the valid field for an OS will be either...

98fa19b0 06/18/2010 12:28 pm Iustin Pop

Fix handling of errors from socket.gethostbyname

Socket functions can raise more than just gaierror. Most of the times,
socket.gethostbyname_ex will return gaierror, but rarely it will also
raise herror. For completeness, we catch all socket exceptions with data...

809bc174 06/17/2010 06:07 pm Michael Hanselmann

RAPI client: Add support for Python 2.6

The httplib module used by urllib2 requires its sockets to have a
makefile() method to provide a file-like interface (or rather
file-in-Python-like) to the socket. PyOpenSSL doesn't implement
makefile() as the semantics require files to call dup(2) on the...

c47478f9 06/14/2010 08:47 pm Iustin Pop

Fix a bug in instance startup with custom hvparams

Since the introduction of OS-specific hvparams, we shouldn't ever use
objects.FillDict directly for instances, but instead go via the cluster
object. Otherwise the os_hvp will be ignored.

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

845da3e8 06/14/2010 08:46 pm Iustin Pop

Fix unsafe variant initializer in _TryOSFromDisk

In case an OS has inconsistent declarations, we might get into a case
where one node reports a valid variants list (with OS API >=15), and
another node has OS API < 15, in which case its supported_variants gets...

27137e55 06/14/2010 12:17 am Iustin Pop

Fix RpcResult.Raise error code

A typo in the Raise() method of rpc.RpcResult means that any remote
errors will lack an appropriate error code; this will confuse e.g. RAPI
users.

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

bd061c35 06/11/2010 12:50 pm Guido Trotter

Enforce consistency in disks and nics input dicts

With this change unknown disk and nic parameters will be refused, rather
than silently ignored, so that one can't pass them in by mistake and not
realize what went wrong.

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

1b67be9b 06/11/2010 12:24 pm Guido Trotter

TLMigrateInstance: pass lu to _Check*

The various _Check* helper functions expect an lu to be passed in, but
the TL is passed instead. This works... sometimes! :)

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

6df291d4 06/10/2010 10:57 pm Iustin Pop

Move fake hypervisor run dir under ganeti

This makes it uniform with the other hypervisors.

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

297e6e53 06/04/2010 04:22 pm Guido Trotter

_ExecuteKVMRuntime: fix hv parameter fun

When executing the kvm runtime we were currently accessing a mix of the
parameters as configured currently on the instance and the ones it was
started with. We were doing it without a precise criteria, but quite by...

fea922fa 06/04/2010 04:22 pm Guido Trotter

Update FinalizeMigration docstring

This is used not only for aborted migrations, so the docstring should
reflect that.

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

41bbdb52 06/04/2010 04:22 pm Guido Trotter

LUGrowDisk: fix operation on down instances

Currently it's impossible to grow a disk if an instance is shutdown,
because the disk could not be assembled. Now we take care of assembling
it, and shutting it down after.

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

ef628379 06/04/2010 04:22 pm Guido Trotter

Allow disk operation to act on a subset of disks

If the disks= parameter is passed, we can assemble/wait for
sync/shutdown only some disks belonging to an instance, rather than all.

This is useful to only activate/sync/shutdown the affected disk when
growing it....

1948e5fe 06/01/2010 08:47 pm Balazs Lecz

Add RemoveDir utility function

Backported from master, 72087dcd5b06c0127e2ec3bf8c80f7f54da3fb01

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

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

2fd7f564 06/01/2010 08:22 pm Guido Trotter

Explicitely return None from IgnoreSignals

Same result, but what happens is clearer.

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

547a63b7 06/01/2010 08:18 pm Balazs Lecz

Add KVM chroot feature

This patch adds a new boolean hypervisor parameter to the KVM hypervisor,
named 'use_chroot'.
If it's turned on for an instance, than KVM is started in "chroot mode":
Ganeti creates an empty directory for the instance and passes the path...

196ec587 06/01/2010 01:24 pm Guido Trotter

FormatUidPool: provide optional roman conversion

The convert= option of compat.tryToRoman is used to do optional
conversion without duplicating formatting code.

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

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

b9b5abcb 06/01/2010 11:47 am Iustin Pop

Add a new opcode timestamp field

Since the current start_timestamp opcode attribute refers to the inital
start time, before locks are acquired, it's not useful to determine the
actual execution order of two opcodes/jobs competing for the same lock.

This patch adds a new field, exec_timestamp, that is updated when the...

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

2652b363 05/31/2010 08:17 pm Tom Limoncelli

RAPI client should convert urllib2.URLError to GanetiApiError

Signed-off-by: Tom Limoncelli <>
Reviewed-by: Michael Hanselmann <>

e43d4f9f 05/31/2010 03:16 pm Apollon Oikonomopoulos

KVM: Migration bandwidth and downtime control

Introduce 2 new hypervisor options, migration_bandwidth and migration_downtime
and implement KVM migration bandwidth and downtime control.

migration_bandwidth controls KVM's maximal bandwidth during migration, in...

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

e0561198 05/27/2010 02:43 pm Iustin Pop

Fix two race conditions in reboot instance

If the instance crashes between backend.InstanceReboot checks the list
of running instances and the execution of hv_xen.RebootInstance,
ini_info will be None. And if the instance doesn't reboot fast enough,
new_info will be None. Both cases lead to “TypeError: unsubscriptable...

31d97b2a 05/25/2010 06:57 pm Guido Trotter

Support for latin friendly output in node list

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

32b1efa1 05/25/2010 01:16 pm Guido Trotter

SingleFileEventHandler: Remove try/except blocks

Since now we use the SingleFileEventHandler together with an error
handling asyncore dispatcher, we don't need the internal try/except
anymore.

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

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

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

daemon.GanetiBaseAsyncoreDispatcher

Abstract a few common functionalities between all ganeti asyncore
dispatchers:
- Handle errors by logging them, and then continue
- By default check sockets only for readability

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

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

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

SingleFileEventHandler: update comments

The comments in the SingleFileEventHandler are still confd-specific.
Update them to make them generic for any single-file monitoring.

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

c666f1f4 05/21/2010 01:45 pm Guido Trotter

Make ConfdInotifyEventHandler a library function

Cut&Paste, plus the following changes:
- The class is renamed to SingleFileEventHandler
- The monitored filename must be passed in and doesn't default to the
ganeti cluster config file
- A small docstring is added to the class...

a2c965ea 05/21/2010 01:45 pm Guido Trotter

Comment on AsyncNotifier upstream's availability

Since we contributed AsyncNotifier back to the upstream pyinotify
project, we'll be able, one day, to remove the ganeti version of that
code. For now we still need it to support older distributions, but
having a note about when we'll be able to remove it is nice....

e22af31d 05/21/2010 01:45 pm Guido Trotter

Remove errors.ConfdFatalError

This exception is caught, but never thrown. It became useless when we
moved confd from on/off to enabled/disabled, but always running on all
nodes. Removing its definition and the code catching it can do no harm.

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

25942a6c 05/18/2010 02:08 pm Guido Trotter

Abstract the LUXI eom into a constant

Currently the EOM terminator is hardcoded on the server side, and is
customizable in the Transport object (with the default being the same as
the value found in the server), but not in the luxi client.

With this patch we move the value to constants, and remove the "fake"...

fbe27e2b 05/18/2010 02:08 pm Guido Trotter

KVM: vhost net acceleration support

This will only work on patched or newer (>= 2.6.34) kernels and with a
patched version of qemu-kvm.

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

5ed59e1e 05/18/2010 01:10 pm Michael Hanselmann

RAPI client: Handle urllib2.HTTPError and raise GanetiApiError

This allows users of the RAPI client to catch GanetiApiError for all HTTP
errors.

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

e8ebbd2b 05/17/2010 01:52 pm Michael Hanselmann

RAPI: /2/{nodes,instances}/$name should return 404 for unknown items

Currently they return a 500 Server Error, not really useful
for detecting nonexistent items.

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

f02fbd30 05/17/2010 01:52 pm Michael Hanselmann

Return disk_template from LUQueryInstanceData

Inter-cluster instance moves need the disk template. As they run
LUQueryInstanceData to get an instance's details, the disk template
must be returned.

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

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

f961e2ba 05/17/2010 01:52 pm Michael Hanselmann

RAPI client: Log request to be made

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

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

b2efcd70 05/14/2010 07:03 pm Guido Trotter

Remove unused import from daemon.py

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

48bf6352 05/14/2010 06:46 pm Guido Trotter

Add a forgotten comment about overriding a method

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

3660fcf5 05/14/2010 06:46 pm Guido Trotter

AsyncUDPSocket.handle_error

By overriding the default asyncore handle_error (which closes the
socket) with our own version, which logs what happened but tries to
proceed, we can get rid of a couple of try/except blocks. The resulting
churn is deindentation of the internal code....

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

20601361 05/13/2010 07:11 pm Luca Bigliardi

Fix some pylint warnings

Disable warnings for:
- except Exception,
- use of __errno_location,
- redeclaration of handleError()

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

6ed0bbce 05/13/2010 06:48 pm Luca Bigliardi

Fix logging string format

Fix this pylint warning:
[W6501, Mlockall] Specify string format arguments as logging function parameters

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

05b35f15 05/13/2010 06:25 pm Luca Bigliardi

Fix Filehandler / FileHandler typo

Fix typo spotted by pylint:
E1101:2095:LogFileHandler.handleError: Module 'logging' has no 'Filehandler' member

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

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

5ef5cfea 05/13/2010 04:58 pm Michael Hanselmann

Mention RAPI client in documentation

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

af6433c6 05/13/2010 04:58 pm Michael Hanselmann

rapi.baserlib: Add function to check variable type

Also add a separate function to retrieve body parameters. Having
it separate (independent of a class instance) will make it easier
to unittest users of this function.

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

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

ff917534 05/13/2010 04:32 pm Luca Bigliardi

Daemons conditionally setup console logging

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

49e60a28 05/13/2010 04:32 pm Luca Bigliardi

Use LogFileHandler conditionally in SetupLogging

Add a parameter to SetupLogging to use LogFileHandler (default is off)

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

de3b8e39 05/13/2010 04:32 pm Luca Bigliardi

Introduce LogFileHandler class

Add a log handler class which logs to /dev/console in case of logging errors.

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

481d47e8 05/13/2010 04:32 pm Luca Bigliardi

Add /dev/console constant

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

1af6ac0f 05/13/2010 04:32 pm Luca Bigliardi

Lock PowercycleNode child in memory

Signed-off-by: Luca Bigliardi <>
Reviewed-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 <>

12eff9b9 05/12/2010 05:30 pm Michael Hanselmann

Fix wrong variable name in commit d975f482

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

d975f482 05/12/2010 02:54 pm Michael Hanselmann

RAPI: Add initial support for instance creation request version

The way the resource /2/instances expects its request data (e.g.
instance name, disks, NICs) to be formatted in a dict is not
very extensible. HV and BE parameters are interleaved with all
other values. In commit 495cfdf0 a new parameter “mode” was added...

682f7601 05/12/2010 02:10 pm Guido Trotter

Convert some ReadFile calls to ReadOneLineFile

For passwords we require strict oneliners, we're a bit more lax with pid
and uid files.

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

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

0d9bc5d2 05/12/2010 01:41 pm Michael Hanselmann

RAPI client: Fix SSL error reporting for real

My previous patch, commit 857705e8, helped in one particular
situation where the exception didn't contain any arguments
(pyOpenSSL reporting a WantReadError, which shouldn't occur with a
blocking socket anyway). With this patch, more common and uncommon...

857705e8 05/11/2010 08:28 pm Michael Hanselmann

RAPI client: Improve SSL error reporting

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

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

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

RAPI client: Add constant for RAPI version

This reverts a60e3cb0a partially by moving the RAPI version into a constant.

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

20b509de 05/11/2010 06:04 pm Michael Hanselmann

Add RAPI client utility module with RAPI PollJob function

The RAPI client module shouldn't depend on any Ganeti module, yet it's
useful to have some Ganeti-specific code, like a PollJob function for
RAPI.

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

dfc8ad25 05/11/2010 06:04 pm Michael Hanselmann

RAPI client: Don't assume job IDs to be numeric

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

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

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

793a8f7c 05/11/2010 05:31 pm Michael Hanselmann

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

768747ed 05/11/2010 05:30 pm Michael Hanselmann

RAPI client: Always pass _SendRequest args as positional

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

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

RAPI client: Simplify URL construction

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

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

RAPI client: Instantiate JSON encoder only once

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

a60e3cb0 05/11/2010 05:27 pm Michael Hanselmann

RAPI client: Hardcode version in URLs

If the version changes, the API is likely to change as well. Not
having to ask for the version first makes the code simpler.

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

95f84636 05/11/2010 11:48 am Iustin Pop

Fix tiny typo in cluster verify

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

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

f724a702 05/10/2010 12:15 pm Balazs Lecz

Force ssh to allocate a tty

This is required to avoid the
"Pseudo-terminal will not be allocated because stdin is not a terminal."
ssh error message in case a Ganeti script is run non-interactively.

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

40bc67e1 05/10/2010 11:56 am Guido Trotter

Retry{Again,Timeout}: explain reraising

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

5ef5ea45 05/10/2010 11:56 am Guido Trotter

IsProcessAlive: retry stat() a few times

On multiprocessor dom0 stat() on /proc can sometimes return EINVAL.
Before giving up, we try a few times to get a consistent answer.

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

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

036c7f68 05/07/2010 05:25 pm Guido Trotter

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Bump version for 2.1.2.1 release
    Update NEWS for Ganeti 2.1.2.1
    KVM: only export instance tags if present

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

1cc831ea 05/07/2010 04:14 pm Guido Trotter

KVM: only export instance tags if present

Currently non-tagged instances fail starting with a TypeError.

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

5bae14d9 05/07/2010 02:34 pm Guido Trotter

ssh.GetUserFiles: move to EnsureDirs

We also create a generic SECURE_DIR_MODE constant, rather than
hardcoding 0700 in the code.

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

98c98ab9 05/07/2010 02:34 pm Guido Trotter

Hypervisors: use utils.EnsureDirs

Swap a few os.mkdir calls with utils.EnsureDirs

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