Statistics
| Branch: | Tag: | Revision:

root / lib @ c4feafe8

# Date Author Comment
c4feafe8 03/08/2010 03:48 pm Iustin Pop

Switch from os.path.join to utils.PathJoin

This passes a full burnin with lots of instances, and should be safe as
we mostly to join a known root (various constants) to a run-time
variable.

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

714ea7ca 03/08/2010 03:46 pm Iustin Pop

Add an extra safety layer to _CleanDirectory

In order to protect from accidental use of _CleanDirectory on a random
directory, we add a list of allowed clean directories, somewhat similar
to _ALLOWED_UPLOAD_FILES (but statically computed).

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

e8022bef 03/02/2010 05:56 pm Vitaly Kuznetsov

Avoid absolute path for privileged commands

Using absolute path for a privileged command is a bad idea as this path may vary.
For example /usr/sbin/brctl in Debian and /sbin/brctl in ALTLinux. Using $PATH is
a better idea.

Signed-off-by: Vitaly Kuznetsov <>...

553bd93f 02/26/2010 04:35 pm Vitaly Kuznetsov

Make SSH_CONFIG_DIR customizable

This patch adds ability to customize ssh config directory with --with-ssh-config-dir
(instead of hardcoded /etc/ssh value). This is useful in Linux distributions with
custom ssh config directories (/etc/openssh in ALTLinux, for example)....

467c1078 02/26/2010 04:23 pm Guido Trotter

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Add NLD constants to Ganeti
    Fix two potentially endless loops in http library
    Fix bug in LUQueryConfigValues
    Fix typo in LUVerifyCluster when checking node time

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

4d32feba 02/26/2010 04:00 pm Guido Trotter

Add NLD constants to Ganeti

This avoids the need for them to be injected in the nbma repository.

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

7b8f3fcd 02/26/2010 03:37 pm Michael Hanselmann

Merge remote branch 'origin/devel-2.0' into devel-2.1

  • origin/devel-2.0:
    Fix two potentially endless loops in http library
    Update NEWS file and bump version to 2.0.6
    ganeti-cleaner: does 'echo 0' instead of 'exit 0'

Conflicts:
NEWS: Trivial
configure.ac: Trivial...

40a09ee1 02/26/2010 03:36 pm Michael Hanselmann

Fix two potentially endless loops in http library

The first can be problematic if poll(2) returns POLLHUP|POLLERR on a
socket. Before it would be only be respected for SOCKOP_RECV, but since
they can also occur on other socket operations, esp. in combination with...

2826b361 02/26/2010 03:20 pm Guido Trotter

Move watcher's EnsureDaemon function to utils

This is going to be used from the nbma repository, to ensure that the
nld daemon is running.

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

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

0be13136 02/26/2010 02:39 pm Michael Hanselmann

Fix two potentially endless loops in http library

The first can be problematic if poll(2) returns POLLHUP|POLLERR on a
socket. Before it would be only be respected for SOCKOP_RECV, but since
they can also occur on other socket operations, esp. in combination with...

cac599f1 02/26/2010 02:38 pm Michael Hanselmann

Fix bug in LUQueryConfigValues

LUQueryConfigValues supports multiple output fields. If the client asked
for the watcher pause status, it would not get a list, but simply the
value.

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

9e289e36 02/26/2010 02:24 pm Guido Trotter

Add watcher hooks

These hooks are run on all nodes, after the "base" daemons are started.

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

30bb62ea 02/25/2010 03:16 pm Michael Hanselmann

Fix typo in LUVerifyCluster when checking node time

The first argument to _ErrorIf should always be True in this case.

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

8b4fe938 02/22/2010 06:02 pm Guido Trotter

Change backend hooks runner to use RunCmd

And save lots of lines of code, in the process

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

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

4403ff8d 02/22/2010 05:56 pm René Nussbaumer

Make it possible to pass custom private key path to SshRunner.Run

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

cb462b06 02/22/2010 05:42 pm Michael Hanselmann

Handle EAGAIN in LUXI client

If too many clients try to connect to the master at the same time, some of
them might fail if the master doesn't accept the connections fast enough.

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

f4484122 02/22/2010 05:42 pm Michael Hanselmann

Show message when job is waiting in queue or for locks

Jobs submitted via the standard command line utilities didn't give any
indication that anything is happening while they were waiting in the job
queue (e.g. due to other jobs using all worker threads) or acquiring...

f7e7689f 02/22/2010 02:50 pm Iustin Pop

Add LUNodeEvacuationStrategy

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

d6aaa598 02/22/2010 02:50 pm Iustin Pop

Add a new opcode for node evacuation

We add this as a new opcode since we don't want to alter the behaviour
of current opcodes/lus.

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

823a72bc 02/22/2010 02:50 pm Iustin Pop

Implement support for mevac in OpTestAllocator

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

7f60a422 02/22/2010 02:50 pm Iustin Pop

Implement IAllocator multi-evacuate mode

This is a new mode that request a solution for the evacuation of
multiple nodes. The external script will be fed a list of names, and is
expected to return a list of [instance, new_node(s)] lists, detailing
the evacuation path of each instance....

680f0a89 02/22/2010 02:50 pm Iustin Pop

Accept both 'nodes' and 'result from iallocator

This patch switches the default result key from 'nodes' to 'result'. The
old name is still accepted for backwards-compatiblity, and should be
removed in later versions.

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

8d3f86a0 02/22/2010 02:50 pm Iustin Pop

Change internal API for the IAllocator class

Currently the 'name' parameter in the constructor is required (as a
non-keyword argument). Since the (to follow) node evac IAllocator mode
doesn't have 'name' as a valid argument, we're moving this one into the...

9757cc90 02/22/2010 02:50 pm Iustin Pop

Remove redundant code in IAllocator class

This moves the setting of the request member on the in_data, of the
request type, and of the branching basef on request type outside of
individual functions and directly into the constructor.

Since the values we're using externally are identical to the...

5627f375 02/19/2010 05:58 pm Michael Hanselmann

bootstrap: Wait for node daemon when adding new node

Until now this was only done for the master node, though
the problem originally fixed in 8f215968 also occurs for
other node daemons.

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

288d9e01 02/18/2010 02:22 pm Michael Hanselmann

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    Fix ssh host key checking with no-key-check
82869978 02/18/2010 02:21 pm Michael Hanselmann

Reset tempfile module after fork where useful

Signed-off-by: Michael Hanselmann <>
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...

e66d9f1a 02/18/2010 12:27 pm Iustin Pop

Fix ssh host key checking with no-key-check

In case we add a node with “--no-ssh-key-check”, this should override
any default yes/ask values in the system-wide (or user) ssh key check.

Currently this only works in batch mode, whereas in non-batch we only...

61dabca4 02/17/2010 08:08 pm Iustin Pop

Simplify a bit _GetWantedNodes

This should have been done in the _ExpandNodeName patch.

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

083a91c9 02/17/2010 06:41 pm Iustin Pop

Fix a wrong docstring

There's no such thing as OpProgrammerError (I found this as I wrote it
in code in another place, and pylint complained).

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

cf26a87a 02/17/2010 03:07 pm Iustin Pop

Remove boiler-plate code about node/instance names

Currently we have lots of duplication of the error-checking (and proper
exception raising) around node/instance name expansion. LUCreateInstance
is the only place where we have abstracted this.

This patch creates two functions (ExpandNodeName and ExpandInstanceName)...

ef7b75b2 02/15/2010 07:03 pm Michael Hanselmann

Merge remote branch 'origin/stable-2.1' into devel-2.1

  • origin/stable-2.1:
    Fix bug introduced in commit 413b747
    Fix locking bug causing high CPU usage
    Fix confd procotol design description
    Implement instance rename QA tests
    Fix "gnt-instance rename" functionality...
d5cd389c 02/15/2010 04:42 pm Iustin Pop

Release all node locks during disk replace

This patch extends commit 7ea7bcf by releasing all node locks in disk
replace for the early release mode. The rationale behind this is:

- LUCreateInstance already releases all node locks while waiting for
disk synchronization, and does an instance startup later...

9122e60a 02/15/2010 04:42 pm Iustin Pop

Unify a few re.compile calls in DRBD

These are both cleanups and, in the case of _MassageProcData, switching
from a weaker RE to a stronger one (we now need cs: in the line,
previosuly any line starting with \d+: was accepted).

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

9af0fa6a 02/15/2010 12:27 pm Iustin Pop

Auto-enable early release for offline old nodes

In case the old node is offline, we won't be able to talk to it to
remove the storage, and in most cases the node is powered
off/unreachable.

In this case, it makes no sense to delay the storage release, so we...

abd8e836 02/11/2010 06:00 pm Iustin Pop

Run instance hooks on more nodes

This should fix issue 68: some hooks should be run on more nodes than
currently. GrowDisk runs on both nodes, remove run the post hook on the
instance's nodes, and failover and migrate run the post hook on the
source node too....

08eec276 02/11/2010 06:00 pm Iustin Pop

Add {NEW,OLD}_{PRIMARY,SECONDARY} vars to hooks

Per issue 71, the migrate and failover need special variables for
keeping the nodes consistent during instance migrations.

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

dd713605 02/11/2010 01:50 pm Iustin Pop

Pass debug mode to noded for OS-related calls

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

cff5fa7f 02/11/2010 01:50 pm Iustin Pop

Add the options attribute to cli.JobExecutor

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

293ba2d8 02/11/2010 01:49 pm Iustin Pop

Implement generic CLI options->opcode updates

This patch changes SubmitOpCode and SubmitOrSend such that we have a
single function that does generic CLI options to opcode attributes
function. This will allow, once all scripts pass the opts argument to
SubmitOpCode, to pass the debug parameter or the dry-run one to the LUs....

ea34193f 02/11/2010 01:46 pm Iustin Pop

Change the debug CLI option to integer/count

This changes from boolean to integer/count (for a future differentiation
based on the actual debug level). All the uses of the code only test
it's boolean status, so it still works as an integer value.

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

ee844e20 02/11/2010 01:46 pm Iustin Pop

Add a generic 'debug_level' attribute to opcodes

Also automatically fix opcodes which have this missing in the LU init
routine.

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

b44b0141 02/10/2010 03:54 pm Michael Hanselmann

Fix bug introduced in commit 413b747

While commit 413b747 fixed the issue of poll(2) returning too
soon, it didn't work when the poll(2) call should've been
blocking. This is now fixed and verified.

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

adf385c7 02/10/2010 03:13 pm Iustin Pop

Fix dumpers/loaders after slots cleanup

Commit 154b958 changed (correctly) the slots usage, but this broke
dumpers/loaders since we relied directly on the own class slots
field.

To compensate, we introduce a simple function for computing the slots...

413b7472 02/10/2010 02:49 pm Michael Hanselmann

Fix locking bug causing high CPU usage

Iustin Pop noticed unusually high CPU usage with 2.1's master
daemon, even with very simple opcodes like OP_TEST_DELAY. As
it turns out, we inadvertently passed seconds as milliseconds
to a call to poll(2). Due to the way the loop around the call...

7ea7bcf6 02/09/2010 12:04 pm Iustin Pop

Add an early release lock/storage for disk replace

This patch adds an early_release parameter in the OpReplaceDisks and
OpEvacuateNode opcodes, allowing earlier release of storage and more
importantly of internal Ganeti locks.

The behaviour of the early release is that any locks and storage on all...

4c06a2d0 02/08/2010 04:04 pm Iustin Pop

Merge branch 'stable-2.1' into devel-2.1

  • stable-2.1:
    TLReplaceDisks: Delay iallocator when evacuating node
    Implement debug level across OS-related RPC calls
    Second try to fix LUVerifyCluster
    LUVerifyCluster: Fix bug with offline nodes
    utils: Fix retry delay calculator...
94a1b377 02/08/2010 01:35 pm Michael Hanselmann

TLReplaceDisks: Delay iallocator when evacuating node

When evacuating nodes, the iallocator was run for all
instances without taking planned changes into consideration.
This patch delays part of CheckPrereq and running the
iallocator for node evacuation....

4a0e011f 02/03/2010 07:04 pm Iustin Pop

Implement debug level across OS-related RPC calls

This doesn't implement the full functionality, we need to add the debug
level to the opcodes too, but at least won't require changing the RPC
calls during the 2.1 series.

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

dd9e9f9c 02/03/2010 03:55 pm Michael Hanselmann

Second try to fix LUVerifyCluster

My previous patch, commit 785d142, fixed the case where a node is marked
offline. With this patch it'll also handle other failures correctly.

  • Hooks Results
    - ERROR: node node2.example.com: Communication failure in hooks...
785d142e 02/03/2010 03:01 pm Michael Hanselmann

LUVerifyCluster: Fix bug with offline nodes

[…] * Other Notes
- NOTICE: 1 offline node(s) found. * Hooks Results
Failure: command execution error:
iteration over non-sequence

Commit a0c9776a introduced an error simulation mode to LUVerifyCluster.
Due to a small mistake, offline nodes weren't skipped when checking the...

26751075 02/03/2010 03:01 pm Michael Hanselmann

utils: Fix retry delay calculator

Before this patch, it would always sleep for at least
the time specified as the upper limit. Now it actually
limits the sleep time.

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

72456eb2 02/01/2010 04:55 pm Michael Hanselmann

Bump RPC protocol version to 30

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

9f53d9ce 02/01/2010 02:55 pm Michael Hanselmann

Merge remote branch 'origin/stable-2.1' into devel-2.1

  • origin/stable-2.1:
    Bump version to 2.1.0~rc5
    Fix missing bridge for xen instances
    Fix flipping MC flag bug
    ganeti-watcher: ensure confd is running as well
433c63aa 02/01/2010 12:37 pm Iustin Pop

Make the snapshot decision based on disk type

… instead of disk size, which is not as reliable. This actually
simplifies the code; but it still leaves the possibility of stack
overflows if the disk data structure is corrupted.

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

0183a697 01/29/2010 01:58 pm Alessandro Cincaglini

Fix missing bridge for xen instances

Xen instances nic definitions miss the target bridge.

This bug was introduced in commit 503b97a9.

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

cea0534a 01/28/2010 04:46 pm Guido Trotter

Fix flipping MC flag bug

Currently unofflining or undraining an already functional master
candidate node, can cause it to demote itself. In order to avoid that we
only trigger the self-promotion check if the node is not currently a
candidate.

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

551b6283 01/28/2010 11:43 am Iustin Pop

Add capability to use syslog for logging

This patch adds a configure-time parameter that will set the defaults
used by all programs, and command-line parameters in the daemons that
allow overriding it.

Syslog 'yes' enables syslog in addition to file-based logging, 'only'...

aac3fbf0 01/27/2010 03:35 pm Iustin Pop

utils.FileLock: handle init errors properly

If the open of the lock file fails (due to whatever reason), 'self'
won't have the 'fd' attribute, and thus we fail in Close/__del__, which
will ruin proper error reporting:

IOError: [Errno 30] Read-only file system: '/var/lib/ganeti/queue/lock'...

ec44d893 01/27/2010 12:19 pm Guido Trotter

locking: add/fix @type information

This patch missing @type information for all public methods, modifies
one to conform to the rest, and removes some information from @param
when it's been expressed in @type.

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

154b9580 01/27/2010 11:17 am Balazs Lecz

Fix slots definitions

According to http://docs.python.org/reference/datamodel.html#slots

  • The action of a slots declaration is limited to the class where it
    is defined. As a result, subclasses will have a dict unless they
    also define slots (which must only contain names of any...
4c1a504b 01/26/2010 02:58 pm Iustin Pop

Merge branch 'devel-2.0' into devel-2.1

  • devel-2.0:
    Fix the mocks.py for 2.0 unittests
    LURemoveNode safety in face of wrong node list
    Fix an unsafe formatting bug
    Ensure all int/float conversions are handled right

Conflicts:
lib/backend.py - trivial merge...

89b70f39 01/25/2010 06:23 pm Iustin Pop

Add a crude disable for DRBD barriers

Ideally we want to/will have per-device DRBD controls of disk/metadata
flushes. In the meantime, we want at least a disable of the barrier
functionality for cases where one has battery-backed caches.

Background: DRBD has four mechanism of handling ordered disk-writes....

9bb31ea8 01/25/2010 06:17 pm Iustin Pop

LURemoveNode safety in face of wrong node list

LURemoveNode runs under the BGL, which means we're guaranteed that the
list of nodes as retrieved in CheckPrereq is still valid in
BuildHooksEnv. However, we can make Ganeti handle failures in case the
locking is broken (or the node list has been modified otherwise) easily,...

62579388 01/25/2010 06:16 pm Iustin Pop

Fix an unsafe formatting bug

This might fix issue 84; in any case, the current situation is that we
have a potentially unsafe formatting, which should be fixed.

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

691744c4 01/25/2010 06:16 pm Iustin Pop

Ensure all int/float conversions are handled right

int()/float() can raise either ValueError (in case of int("a")), or
TypeError (in case of int(None)). We had many bugs over time due to
this, and a recent one was just diagnosed, so we go over the codebase...

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...
e4dd2299 01/22/2010 03:45 pm Guido Trotter

KVM: fix pylint warning

Specify string format arguments as logging function parameters

Signed-off-by: Guido Trotter <>

c4e388a5 01/22/2010 03:05 pm Guido Trotter

KVM: be more resilient on broken migration answers

Before, when doing kvm live migrations we use to accept an "unknown
status" but to reject anything that didn't match our regexp. Since we've
seen "info migrate" return a completely empty answer, we'll be more...

ec39d63c 01/20/2010 03:47 pm Michael Hanselmann

cli: Fix bug when not using headers

Commit 9fe72672 added code to not write spaces at the end of each line.
Unfortunately it didn't work properly when not printing headers—there would
still be spaces.

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

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...
1b3a7656 01/15/2010 01:22 pm Iustin Pop

Switch the SplitKeyVal function to accept escapes

This tiny patch switches the SplitKeyVal function (and thus the command
line options like -H, -B, etc.) to UnescapeAndSplit, thus allowing one
to use escaped commas in the values of parameters.

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

db169865 01/14/2010 07:07 pm Guido Trotter

confd client: copy the peers in UpdatePeerList

Since the peer list is shuffled by the client, we don't keep a reference
to the list which was passed in, but copy it internally.

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

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

e2e92ea0 01/13/2010 06:45 pm Guido Trotter

Generate hmac file with a newline at the end

This makes it slightly easier to cut&paste its content.

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

d2c8afb1 01/13/2010 05:47 pm Michael Hanselmann

jqueue: Don't return negative number for unchecked jobs when archiving

When the queue was empty, the calculation for unchecked jobs while
archiving would return -1. ``last_touched`` is set to 0, the job ID list
(``all_job_ids``) is empty. Calculating ``len(all_job_ids) -...

9fe72672 01/13/2010 03:03 pm Michael Hanselmann

cli.GenerateTable: Don't write EOL spaces

With this change, there won't be unnecessary space characters
at the end of lines.

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

9fa2e150 01/13/2010 03:03 pm Michael Hanselmann

Improve logging for workerpool tasks by providing repr

Before it would log something like “starting task
(<ganeti.http.client._HttpClientPendingRequest object at 0x2aaaad176790>,)”,
which isn't really useful for debugging. Now it'll log “[…]
<ganeti.http.client._HttpClientPendingRequest...

02fc74da 01/13/2010 03:03 pm Michael Hanselmann

workerpool: Simplify log messages

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

d16e6fd9 01/13/2010 03:03 pm Michael Hanselmann

workerpool: Use worker name as thread name

This way it shows up in debug logs.

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

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

71e1863e 01/13/2010 03:02 pm Michael Hanselmann

locking: Fix race condition in LockSet

This patch fixes a race condition when acquiring all locks in
a LockSet instance. The list of lock names needs to be sorted
to guarantee a consistent locking order, but the names were not
sorted when acquiring all locks in the set....

4776e022 01/13/2010 03:02 pm Michael Hanselmann

mcpu: Log lock status with sorted names

Reading and comparing sorted lists is easier when debugging locking problems.

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

9b154270 01/13/2010 03:02 pm Michael Hanselmann

locking: Append to list outside error handling block

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

56452af7 01/13/2010 03:02 pm Michael Hanselmann

locking: Don't fail in error handling if lock isn't owned

In case an exception was thrown while acquiring the lock, not necessarily all
owned locks are also really acquired. Before this change, an exception could be
masked by another exception thrown here. There is no good clean-up strategy...

82187135 01/11/2010 02:25 pm René Nussbaumer

Normalize MAC addresses to all lower.

This change will normalize the MAC to all lower after validation.

Signed-off-by: René Nussbaumer <>
Signed-off-by: Iustin Pop <>
Reviewed-by: Iustin Pop <>

7699c3af 01/05/2010 02:56 pm Iustin Pop

Introduce a Luxi call for GetTags

This changes from submitting jobs to get the tags (in cli scripts) to
queries, which (since the tags query is a cheap one) should be much
faster.

The tags queries are already done without locks (in the generic query
paths for instances/nodes/cluster), so this shouldn't break tags query...

47a72f18 01/05/2010 02:39 pm Iustin Pop

LURenameCluster: run post hook on all nodes

Since the cluster name might be used for various purposes on nodes, we
should let all nodes "know" about a cluster rename by running the post
hook on all nodes. This will make cluster rename slightly
slower/costlier, but it is not/shouldn't be an operation that is run...

30e4e741 01/04/2010 11:20 am Iustin Pop

Fix unused imports or add silences where needed

In some cases pylint doesn't parse the import correctly, so we add
silences; but there are also many cases of unused imports, which we
simply remove.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

527a15ac 01/04/2010 11:17 am Iustin Pop

bdev: Add a TODO and a pylint silence

A piece of old code in bdev.py uses a for loop over a single variable
because we can 'break' out of the loop or exit on the 'else' path. This
is not a nice usage of the for loop, it should be converted to a
standard if...elif...else structure....

2d54e29c 01/04/2010 11:17 am Iustin Pop

Further pylint disables, mostly for Unused args

Many of our functions have to follow a given API, and thus we have to
keep a given signature, but pylint doesn't understand this. Therefore,
we silence this warning.

The patch does a few other cleanups.

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

857121ad 01/04/2010 11:16 am Iustin Pop

LUDiagnoseOS._DiagnoseByOS: remove unused arg

The node_list argument to _DiagnoseByOS is not used, and is obsoleted by
the fact that the rlist argument already has the valid nodes as keys
(assuming RPC behaviour didn't change). Thus, we remove it and silence...

7ed85ffe 01/04/2010 11:16 am Iustin Pop

hv_xen/_GetConfigFileDiskData: remove unused arg

The disk template is not needed, all that's used is the disk data. As
such, remove this parameter from the function.

Signed-off-by: Iustin Pop <>
Reviewed-by: Olivier Tharan <>

45e0d704 01/04/2010 11:16 am Iustin Pop

jqueue/_CheckRpcResult: log the whole operation

Currently only the rpc call, but not its description (which also shows
the argument) is logged. We change this to log failmsg too, and this
also silences a warning.

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