Statistics
| Branch: | Tag: | Revision:

root / test / ganeti.tools.ensure_dirs_unittest.py @ 383477e9

History | View | Annotate | Download (2.6 kB)

# Date Author Comment
e37f47d3 12/13/2012 01:27 pm Michael Hanselmann

Improve test for tools.ensure_dirs

- Add more checks, some of them are deliberately redundant
- Descriptive error messages
- Add comment describing order to “tools.ensure_dirs”
- Avoid copying a list in an assertion in “tools.ensure_dirs”

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

b81b3c96 10/26/2011 11:42 am René Nussbaumer

ensure_dirs: Move some useful functions into utils.

With this change we can easily reuse this functionality where it makes
sense on other parts of Ganeti.

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

c3f54085 08/19/2011 03:11 pm Michael Hanselmann

ensure-dirs: Check mode and owner before changing

This avoids many calls to chmod(2) and chown(2), and thereby ctime
updates.

Since I had to update the unittests anyway I untangled the code a bit,
split it into more separate functions and added some more tests....

d00a730d 08/19/2011 03:11 pm Michael Hanselmann

ensure-dirs: Refine error handling on stat(2)

The “_stat_fn” function is renamed to “_lstat_fn” to reflect its
function. The try/except block just wraps calling lstat(2) and nothing
else.

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

0d2bf835 03/24/2011 10:29 am René Nussbaumer

Rewrite of ensure-dirs in python

I provided unittest to test the important pieces of the infrastructure.
The one remaining function (ResuriveEnsure) is not easy to unittest
but also not critical if it fails to operate correctly.

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