Make the cleanup() function just remove the tmpdir location.
This commit is contained in:
parent
fe8b541620
commit
3ec372e546
@ -130,5 +130,4 @@ if __name__ == "__main__":
|
|||||||
sys.stderr.write("Error writing %s/.discinfo file.\n" % (output,))
|
sys.stderr.write("Error writing %s/.discinfo file.\n" % (output,))
|
||||||
|
|
||||||
# clean up
|
# clean up
|
||||||
trash = [yumconf, treedir, buildinstdir]
|
pylorax.cleanup()
|
||||||
pylorax.cleanup(trash)
|
|
||||||
|
@ -201,13 +201,14 @@ def cleanup(trash=[]):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if trash is []:
|
if trash != []:
|
||||||
return
|
for item in trash:
|
||||||
|
if os.path.isdir(item):
|
||||||
|
shutil.rmtree(item, ignore_errors=True)
|
||||||
|
else:
|
||||||
|
os.unlink(item)
|
||||||
|
|
||||||
for item in trash:
|
if os.path.isdir(conf['tmpdir']):
|
||||||
if os.path.isdir(item):
|
shutil.rmtree(conf['tmpdir'], ignore_errors=True)
|
||||||
shutil.rmtree(item, ignore_errors=True)
|
|
||||||
else:
|
|
||||||
os.unlink(item)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user