Statistics
| Branch: | Tag: | Revision:

root / lib / utils.py @ 21004460

History | View | Annotate | Download (105.7 kB)

# Date Author Comment
4138d39f 10/22/2010 06:22 pm Iustin Pop

Add a "safe" file wrapper over WriteFile

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

9e100285 10/22/2010 06:21 pm Iustin Pop

Add functions to read and compare file 'ID's

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

691c81b7 10/20/2010 03:53 pm Michael Hanselmann

utils: Add function to find items in dictionary using regex

This basically extracts a small piece of code from ganeti-rapi and puts
it into a utility function. RAPI resources are found using a dictionary
in which the keys can either be static strings or compiled regular...

614244bd 10/12/2010 04:32 pm Iustin Pop

Fix epydoc errors

And sorry!

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

ed3920e3 10/07/2010 11:32 am Iustin Pop

Fix a rare bug in StartDaemonChild and GenericMain

I've seen cases where the result from str(sys.exc_info()[1]) is ""; this
breaks the error reporting as the parent relies on non-empty error
messages to properly detect child status (otherwise it will try to read...

b78aa8c2 10/07/2010 11:31 am Iustin Pop

Change daemon.GenericMain/utils.Daemonize workflow

This patch copies the pipe-based error reporting functionality from
utils.StartDaemon (I gave up for now on tryin to merge the two).

This patch will fix two longstanding bugs:

- if we fork, we lose all error reporting from the child to the original...

5c4d37f9 10/07/2010 11:31 am Iustin Pop

Use only one version of WritePidFile

This patch merges the pid file handling used for ganeti-* daemons and
impexp daemons. The latter version is used, since it's more reliable:
uses locked pid files as opposed to checking 'live' processes.

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

79634555 10/07/2010 11:30 am Iustin Pop

Abstract daemon file descriptor setup

This does some slight changes:

- Daemonize() doesn't explicitly close the file-descriptors anymore, but
only implicitly via the usage of dup2
- StartDaemonChild uses separate devnull for stdin (rdonly) and
stdout/stderr (wronly), or if using a log file, it uses it in append...

0260032c 10/07/2010 11:30 am Iustin Pop

Abstract some daemon functionality

This patch abstracts the chdir/umask/setsid functionality, which is
identical in the code functions, just that Daemonize did the chdir/umask
in the second child; with this change it does it in the first, as
StartDaemon....

05636402 09/29/2010 02:42 pm Guido Trotter

Move the uuid regexp to utils.py

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

5ee6fffc 09/22/2010 05:57 pm Michael Hanselmann

Merge branch 'devel-2.2'

  • devel-2.2:
    NEWS: Add 2.2.0~rc2 release date
    Bump version to 2.2.0~rc2
    Fix mac checker regex
    Remove two old aliases
    Fix migration on new KVMs
    Fix typo in ganeti man page
    cli: Pass options in {Add,Remove}Tags
    Prepare 2.2.0~rc2 release...
cb639800 09/22/2010 04:16 pm Michael Hanselmann

Merge branch 'devel-2.1' into devel-2.2

  • devel-2.1:
    Fix mac checker regex

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

8fb00704 09/22/2010 02:12 pm Iustin Pop

Fix mac checker regex

Currently, the mac checker regex could match a corner case of
11:22:33:44:55:66: (one extra colon at the end). We fix this, and we
also move the regex compilation outside of this function, at module
level.

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

0070a462 09/07/2010 02:26 pm René Nussbaumer

Revert "Make it possible to call utils.Daemonize with uid and gid to run as"

This reverts commit 743b53d4eb9f3de46edb5e54738dab287b1979ac.

Conflicts:

lib/daemon.py

Trivial conflict resolved. This patch reverts changes from earlier permissions
separation stage. This is not needed anymore as start-stop-daemon takes care...

ea8ac9c9 08/23/2010 03:40 pm René Nussbaumer

Switch to the RPC call to update /etc/hosts in LUAddNode and LURemoveNode

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

edcd876b 08/19/2010 06:27 pm Michael Hanselmann

utils: Use WriteFile in {Set,Remove}EtcHostsEntry

This avoids duplicate effort and has been a TODO for a long time.

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

0963d545 08/19/2010 03:12 pm René Nussbaumer

Make it possible to invoke RunCmd in interactive mode

This is needed so we can run external scripts asking for password and such
to run interactive. Downside is that we can't get the output of the program
but we can still use the exit code.

Signed-off-by: René Nussbaumer <>...

b43dcc5a 08/19/2010 12:44 pm Manuel Franceschini

Support IPv6 node add

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

b705c7a6 08/18/2010 11:27 am Manuel Franceschini

Support for resolving hostnames to IPv6 addresses

This patch enables IPv6 name resolution by using socket.getaddrinfo
instead of socket.gethostbyname_ex.

It renames the HostInfo class to Hostname and unifies its use throughout
the code. This is achieved by using static calls where no object is...

59525e1f 07/30/2010 06:33 pm Michael Hanselmann

Add new parameter type “maybe string”

Before strict checking was implemented, NIC IP addresses could be set
to “None”. Commit bd061c35 added more strict checking, including
enforcing the IP address to be a string. With this new type, it
can again be set to None....

2ea65c7d 07/23/2010 03:19 pm Manuel Franceschini

utils: Fix incorrect docstring

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

600535f0 07/21/2010 12:34 pm Manuel Franceschini

Always set commonName in X509 certificates

Due to the current switch of the RPC client to PycURL, a bug with newer
versions of libcurl surfaced. When the 'Subject' or 'Issuer' of
'server.pem' were empty, SSL handshake failed.

This patch changes the certificate generation functions such that they...

3727671e 07/20/2010 12:34 pm René Nussbaumer

Change AddAuthorizedKey to also allow filehandles

This is required to use this function over paramiko
sftp file handles.

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

31155d60 07/16/2010 12:47 pm Balazs Lecz

Add ParseCpuMask() utility function

Also adds a generic ParseError exception.

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

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

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

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

ac492887 07/01/2010 03:14 pm Michael Hanselmann

utils.OwnIpAddress: Change try/except for Python 2.4

Python 2.4 doesn't support “except” and “finally” in the same block.

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

56e4c4a0 06/30/2010 04:58 pm Manuel Franceschini

Enable utils.OwnIpAddress to work with IPv6 addresses

Currently a TcpPing using the target address as source is used to
determine wheter or not an IP address belongs to a node. This does not
work for IPv6 anymore (I'm not sure why) as binding to IPv6 localhost as...

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

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

23e0ef8c 06/29/2010 05:30 pm Guido Trotter

Fix a few uncommon pylint errors in compat.py

- It's ok if the optional modules functools, roman and hashlib are not there.
- It's ok to reference any and all before defining them. We're doing all
this exactly because, under python 2.4, they are undefined....

41a26b68 06/28/2010 02:04 pm Guido Trotter

Remove utils.LockedMethod

All users of this function were converted to another method, hence we
can remove it.

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

626f4e45 06/18/2010 02:23 pm Guido Trotter

Merge branch 'stable-2.1'

  • stable-2.1:
    Bump up version for the 2.1.4 release
    Update NEWS about the latest 2.1 change
    Fix handling of errors from socket.gethostbyname
    Update a comment in qa-sample.json
    RAPI client: Add support for Python 2.6
    Update NEWS for Ganeti 2.1.4...
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...

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

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

743b53d4 06/04/2010 05:22 pm René Nussbaumer

Make it possible to call utils.Daemonize with uid and gid to run as

Signed-off-by: René Nussbaumer <>
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 <>

db147305 06/03/2010 12:39 pm Tom Limoncelli

ganeti-watcher should attempt to fix ganeti-rapi

Update ganeti-watcher so that it tests the master's RAPI port with a
simple test (in this case GetVersion). If it fails, make one attempt
at restarting ganeti-rapi and retest.

- daemons/ganeti-watcher: Test rapi and make one attempt at restarting 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 <>

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

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

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

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

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

72087dcd 05/28/2010 03:36 pm Balazs Lecz

Add RemoveDir utility function

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

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...
c7406bbe 05/14/2010 07:07 pm Guido Trotter

RetryOnSignal: handle socket error as well

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

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

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

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

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

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

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

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

b9768937 04/27/2010 05:22 pm Michael Hanselmann

Add wrapper class for signal.set_wrapper_fd

Managing file descriptors is always a bit tricky. Having this in a separate
class is better.

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

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

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

af2ae1c0 04/16/2010 03:06 pm Iustin Pop

Merge branch 'devel-2.1'

  • devel-2.1:
    utils: Add class to split string stream into lines
    Fix cluster behaviour with disabled file storage
    Update docstrings in tools/ and enable epydoc
    Forward-port the ganeti 2.0 cfgupgrade
    Add a new tool: sanitize-config...
339be5a8 04/15/2010 06:24 pm Michael Hanselmann

utils: Add class to split string stream into lines

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

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

cf6fee17 04/07/2010 06:47 pm Michael Hanselmann

Merge branch 'devel-2.1'

  • devel-2.1:
    Fix consistency checks in ConfdFilterCallback
    Fix utils.WaitForFdCondition inner retry loop
    Fix bug introduced in 76e5f8b54: mkdir mode
    utils: Move wrapper code around os.makedirs into separate function
    Fix unittest for the rapi client library...
1b429e2a 04/07/2010 04:55 pm Iustin Pop

Fix utils.WaitForFdCondition inner retry loop

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

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

cc2f004d 04/07/2010 04:31 pm Michael Hanselmann

Fix bug introduced in 76e5f8b54: mkdir mode

After commit 76e5f8b54, mkdir_mode in utils.RenameFile is
no longer passed to Makedirs. This is fixed by this patch.

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

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

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

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

24f40363 03/23/2010 11:56 am Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    ganeti-confd: Call pyinotify flags correctly
    Fix burnin error when trying to grow a file volume
    Some epydoc fixes
    A rewrite of LUClusterVerify
    Introduce a bool CLI option type
    Fix backend.VerifyNode behaviour for VG problems...
284c69f0 03/22/2010 08:06 pm Guido Trotter

Revert "Only override any and all if not defined"

This reverts commit bd5617020a50bcd08269330638d64078c1b30b71.

Turns out our and python's any/all are not compatible.

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

791f317d 03/18/2010 03:56 pm Guido Trotter

Merge branch 'devel-2.1'

  • devel-2.1:
    burnin: implement basic confd testing
    AsyncUDPSocket.process_next_packet
    WaitForSocketCondition: rename, handle EINTR
    move http.WaitForSocketCondition to utils
    ConfdCountingCallback
    ConfdClient: add synchronous features...
dcd511c8 03/18/2010 01:39 pm Guido Trotter

move http.WaitForSocketCondition to utils

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

dfdc4060 03/18/2010 01:39 pm Guido Trotter

WaitForSocketCondition: rename, handle EINTR

- Rename WaitForSocketCondition to SingleWaitForFdCondition
- Avoid potentially infinite loop, if we continue to get interrupted
- Handle eintr correctly
- Avoid the poller try/finally, as the poller object gets destroyed...

bd561702 03/18/2010 01:38 pm Guido Trotter

Only override any and all if not defined

If any or all are already defined (because we're using a new version of
python) just link them inside "utils" rather than redefining them.

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

68857643 03/17/2010 05:18 pm Michael Hanselmann

utils: Add functions to sign and verify X509 certs using HMAC

Certificates exchanged via an untrusted third party should be
signed to ensure they haven't been modified.

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

bb3776b4 03/15/2010 04:25 pm Michael Hanselmann

Merge remote branch 'origin/devel-2.1'

  • origin/devel-2.1: (116 commits)
    Implement replacing cluster certs and keys via “gnt-cluster renew-crypto”
    cli: Add helper function to stop and start whole cluster
    cfgupgrade: Use new bootstrap function for certs and keys...