Statistics
| Branch: | Tag: | Revision:

root / lib / utils @ d242923c

Name Size
__init__.py 23.1 kB
algo.py 7.3 kB
filelock.py 5 kB
hash.py 2.4 kB
io.py 29 kB
log.py 9.5 kB
mlock.py 2.3 kB
nodesetup.py 3.4 kB
process.py 29.8 kB
retry.py 6.2 kB
text.py 16.8 kB
wrapper.py 5.3 kB
x509.py 12.3 kB

Latest revisions

# Date Author Comment
d242923c 12/04/2012 11:22 am Michael Hanselmann

utils.text: Function to verify MAC address prefix

The network management code needs to verify a MAC address prefix.
Instead of (ab)using NormalizeAndValidateMac, clean code should be used.
Unit tests for NormalizeAndValidateMac are updated and new ones for...

0602cef3 12/03/2012 04:33 pm Michael Hanselmann

Factorize code for checking node daemon certificate

This code is going to be used by a new utility for setting up the node
daemon. Unit tests are updated/added.

Additionally, the certificate and key stored in “server.pem” are
verified, too.

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

86b9a385 11/30/2012 11:44 am Michael Hanselmann

Fix breakage introduced in commit a8b3b09

The order of the calls to “ctx.use_privatekey” and “ctx.use_certificate”
was wrong, leading to an exception being thrown.

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

a8b3b09d 11/30/2012 10:51 am Michael Hanselmann

Factorize SSL context setup for certificate check

This code will also be used by the node daemon setup utility.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Helga Velroyen <>

796b5152 11/27/2012 12:54 pm Michael Hanselmann

Factorize logging setup in tools

Most tools had their own “SetupLogging” function, but they were all
essentially the same. This patch adds a generic version to “utils.log”
and provides unit tests.

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

3c286190 11/20/2012 07:51 pm Dimitris Aragiorgis

Fixes to pass pep8 (make lint)

Signed-off-by: Dimitris Aragiorgis <>
Reviewed-by: Iustin Pop <>

2f18052f 11/14/2012 10:16 am Michael Hanselmann

utils.process.RunResult: Always set "fail_reason" attribute

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

09b72783 11/12/2012 06:51 pm Michael Hanselmann

RunCmd: Expose "postfork" callback

The “_postfork_fn” parameter was only used for tests until now. To
implement a good locking scheme, remote commands must also make use of
this callback to release a lock when the command was successfully
started (but did not yet finish)....

10b86782 11/06/2012 07:59 pm Michael Hanselmann

Add utility to check if file is executable

This replaces direct calls to “os.access” and
“os.path.exists”/“os.path.isfile”.

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

2826897c 11/06/2012 04:00 pm Michael Hanselmann

utils.io: Improve handling of double and single slashes

Up until now “IsBelowDir("/", …)” would never return True. The reason
was that an additional slash was added to the root path resulting in
“//", which is “implementation-defined” in posix and treated specially...

View revisions

Also available in: Atom