ensure-dirs: Check mode and owner before changing
authorMichael Hanselmann <hansmi@google.com>
Fri, 19 Aug 2011 11:14:04 +0000 (13:14 +0200)
committerMichael Hanselmann <hansmi@google.com>
Fri, 19 Aug 2011 12:11:37 +0000 (14:11 +0200)
commitc3f54085a6c91c0b36a205ea01e6769af9ec4059
treedbc451465c20214f75c4e67da1d9459ae8d7e29e
parentd00a730d2cd8294e06c46274a94cf6ace4dee4b1
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.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>
lib/tools/ensure_dirs.py
test/ganeti.tools.ensure_dirs_unittest.py