Statistics
| Branch: | Tag: | Revision:

root / lib / utils @ 4af458e3

Name Size
__init__.py 23.1 kB
algo.py 7.3 kB
filelock.py 5 kB
hash.py 2.4 kB
io.py 28.2 kB
log.py 8.4 kB
mlock.py 2.3 kB
nodesetup.py 3.4 kB
process.py 28.6 kB
retry.py 6.2 kB
text.py 15 kB
wrapper.py 5 kB
x509.py 9.5 kB

Latest revisions

# Date Author Comment
4af458e3 09/19/2012 04:54 pm Michael Hanselmann

ShellWriter: Add parameter to disable indentation

This will be used to write a more compact bash completion script.

Signed-off-by: Michael Hanselmann <>
Reviewed-by: Bernardo Dal Seno <>

111a7d04 09/18/2012 06:11 pm Michael Hanselmann

Migrate lib/utils/*.py from constants to pathutils

File system paths moved from constants to pathutils.

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

3329f4de 09/18/2012 05:58 pm Michael Hanselmann

constants: Move most paths to separate module

This is inpreparation for the implementation of virtual clusters. Many
paths will change based on an environment variable and are no longer
constant and should no longer be in “constants.py”. Since “constants.py”...

5ae4945a 08/23/2012 02:41 pm Iustin Pop

Bump pep8 version to 1.2

Debian Wheezy will ship with this version, and it has many improved checks compared to 0.6, so let's:

- bump version in the docs
- silence some new checks that are wrong due to our indent=2 instead of 4
- fix lots of errors in the code where the indentation was wrong by 1...

32be86da 06/15/2012 04:48 pm René Nussbaumer

Verify user supplied dicts against defaults

This verifies the user (especially in nested dicts) does not
provide a key which is not seen in the defaults dict for that dict.

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

f97a7ada 05/09/2012 12:12 pm Iustin Pop

Allow clock skews in certificate verification

Currently we allow for up to NODE_MAX_CLOCK_SKEW time difference
between nodes in some operations, but not everywhere: SSL certificate
verification (import/export, both intra and inter-cluster) has a zero
limit (downwards), and a week upwards. This can cause even...

21864565 04/26/2012 05:17 pm Iustin Pop

Log all external commands execution

This logs all external commands in normal (non-debug) mode. This will
leak the DRBD secrets, but in any case we do log failed commands, so
it's not a significant change.

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

dd27bc21 04/19/2012 09:04 pm Michael Hanselmann

utils.algo: Use str.isdigit instead of regular expression

str.isdigit is about 4x faster than using a regular expression ("\d+").
This is in the inner sorting code so speed matters.

$ python -m timeit -s 'import re; s = re.compile("^\d+$")' \
's.match(""); s.match("Hello World"); s.match("1234")'...

26a72a48 03/30/2012 03:02 pm Michael Hanselmann

Merge cli.FormatTimestamp and utils.FormatTime

… to some degree at least. Unittests are included.

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

81f7ea25 03/09/2012 04:46 pm Iustin Pop

Fix lint error in commit 035b33e2

Commit 035b33e2 forgot one blank space, and current pylint in Debian
Sid doesn't run on our code… so I didn't realise this until after
commit, sorry.

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

View revisions

Also available in: Atom