details: http://www.bx.psu.edu/hg/galaxy/rev/7a6f75bf4be5 changeset: 2423:7a6f75bf4be5 user: Nate Coraor <nate@bx.psu.edu> date: Thu May 28 15:18:49 2009 -0400 description: Fix the cleanup_datasets script 1 file(s) affected in this change: scripts/cleanup_datasets/cleanup_datasets.py diffs (17 lines): diff -r a07e84e73b45 -r 7a6f75bf4be5 scripts/cleanup_datasets/cleanup_datasets.py --- a/scripts/cleanup_datasets/cleanup_datasets.py Thu May 28 13:58:56 2009 -0400 +++ b/scripts/cleanup_datasets/cleanup_datasets.py Thu May 28 15:18:49 2009 -0400 @@ -264,8 +264,13 @@ if dataset.extra_files_path and os.path.exists( dataset.extra_files_path ): shutil.rmtree( dataset.extra_files_path ) #we need to delete the directory and its contents; os.unlink would always fail on a directory dataset.purged = True + dataset.flush() else: print "# This dataset (%i) is not purgable, the file (%s) will not be removed.\n" % ( dataset.id, dataset.file_name ) + except OSError, exc: + print "# Error, file has already been removed: %s" % str( exc ) + dataset.purged = True + dataset.flush() except Exception, exc: print "# Error, exception: %s caught attempting to purge %s\n" %( str( exc ), dataset.file_name ) else: