-
Committer:
Scott Moser
-
Date:
2016-02-11 19:33:32 UTC
-
mfrom:
(347.1.2 trunk.dir-cleanup)
-
Revision ID:
smoser@ubuntu.com-20160211193332-bvsib0gygaf5qty3
vmtest: image_sync: fix removal of old directories
The net of these changes is that we now cleanup old directories
when we were not doing so before.
The changes specifically:
- use remove_item rather than remove_version.
remove_version had nothing in the data that was being passed
to us as the tree had already had all the items removed from it.
So when walking 'for item in ...' there were no items.
- change a print to a LOG.info()
info is admittedly a bit loud, but for now we want to see it.
- remove_empty_dir:
one clear bug fix. the indentation was broken and we would
only call recursively if it *did* end with a /.
instead remove trailing / before calling dirname.
Now calls look like:
remove_empty_dir("foo/bar/zee/////")
# remove foo/bar/zee
remove_empty_dir("foo/bar")
remove_empty_dir("foo")