Statistics
| Branch: | Tag: | Revision:

root / lib / utils @ 10b86782

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 8.4 kB
mlock.py 2.3 kB
nodesetup.py 3.4 kB
process.py 29.6 kB
retry.py 6.2 kB
text.py 15.4 kB
wrapper.py 5.3 kB
x509.py 9.8 kB

Latest revisions

# Date Author Comment
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...

d5d76ab2 10/26/2012 05:27 pm Michael Hanselmann

RunCmd: Support standard input file descriptor

This patch changes “utils.RunCmd” to accept a file-like object or a
numeric file descriptor which will be used as the command's standard
input. One use-case will be to pass all necessary data to
“prepare-node-join”....

6b96df59 10/26/2012 03:37 pm Michael Hanselmann

utils.x509: Factorize code to extract X509 certificate

This will be useful in “gnt-node add”.

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

d12b9f66 10/23/2012 06:32 pm Michael Hanselmann

Add initial implementation of prepare-node-join

This is a new tool as per the design document “design-ssh-setup”. It
receives a JSON data structure on its standard input and configures the
SSH daemon and root's SSH keys accordingly. Unit tests are included....

0232b768 10/19/2012 02:43 pm Michael Hanselmann

Compare significant fields only for simple SSH keys

For simple SSH keys, that is those without options such as
“command="…"”, only the first two parts need to be compared. The third
field is a free-form comment.

This patch changes the comparison used in...

ee045466 10/11/2012 12:56 pm Michael Hanselmann

Move constant for /etc/hosts to pathutils

Needed for coming patches.

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

6a9b9778 10/05/2012 04:52 am Michael Hanselmann

utils.FilterEmptyLinesAndComments: Return list

We don't use generators often and lists are easier to re-use.

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

2cbe9af3 10/04/2012 04:42 pm Michael Hanselmann

Factorize removing comments and empty lines from string

This will also be used for verifying the file storage directory.

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

2b3b41df 09/21/2012 07:07 am Michael Hanselmann

utils.filelock: Remove executable bit from lock files

There's no need for lock files to be executable.

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

View revisions

Also available in: Atom