Make the cleanup() function just remove the tmpdir location.

This commit is contained in:
David Cantrell 2008-10-04 20:59:46 -10:00
parent fe8b541620
commit 3ec372e546
2 changed files with 9 additions and 9 deletions

View File

@ -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)

View File

@ -201,13 +201,14 @@ def cleanup(trash=[]):
""" """
if trash is []: if trash != []:
return
for item in trash: for item in trash:
if os.path.isdir(item): if os.path.isdir(item):
shutil.rmtree(item, ignore_errors=True) shutil.rmtree(item, ignore_errors=True)
else: else:
os.unlink(item) os.unlink(item)
if os.path.isdir(conf['tmpdir']):
shutil.rmtree(conf['tmpdir'], ignore_errors=True)
return return