Fix error when removing a symbolic link to a dir
This commit is contained in:
parent
45c5ef566c
commit
f96f015593
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user