imgcreate/creator.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
New commits: commit 0b80dc71f82f0a2ed24d01209fd2eb892a2c8135 Author: Warren Togami <[email protected]> Date: Thu Sep 10 16:01:57 2009 -0400 Properly clean up fake /selinux directory during teardown diff --git a/imgcreate/creator.py b/imgcreate/creator.py index 910c778..909f616 100644 --- a/imgcreate/creator.py +++ b/imgcreate/creator.py @@ -476,13 +476,18 @@ class ImageCreator(object): # if the system was running selinux clean up our lies if os.path.exists("/selinux/enforce"): for root, dirs, files in os.walk(self._instroot + "/selinux"): - if root == self._instroot + "/selinux": - continue - try: - os.unlink(root) - except OSError: - pass - + for name in files: + try: + os.remove(os.path.join(root, name)) + except OSError: + pass + for name in dirs: + if os.path.join(root, name) == self._instroot + "/selinux": + continue + try: + os.rmdir(os.path.join(root, name)) + except OSError: + pass def mount(self, base_on = None, cachedir = None): """Setup the target filesystem in preparation for an install. -- Fedora-livecd-list mailing list [email protected] https://www.redhat.com/mailman/listinfo/fedora-livecd-list
