Fix error when removing a symbolic link to a dir

This commit is contained in:
Martin Gracik 2010-10-12 18:56:08 +02:00
parent 45c5ef566c
commit f96f015593

View File

@ -107,10 +107,10 @@ class LoraxYumHelper(object):
fullpattern = joinpaths(self.installroot, pattern)
count = 0
for fname in glob.glob(fullpattern):
if os.path.isdir(fname):
shutil.rmtree(fname)
else:
if os.path.islink(fname) or os.path.isfile(fname):
os.unlink(fname)
else:
shutil.rmtree(fname)
logger.debug("removed {0}".format(fname))
count += 1