Skip to content

Instantly share code, notes, and snippets.

@MahatiC
Created September 2, 2016 11:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MahatiC/f64ae7c08f5897ebe43415677486ed3c to your computer and use it in GitHub Desktop.
Save MahatiC/f64ae7c08f5897ebe43415677486ed3c to your computer and use it in GitHub Desktop.
diff --git a/swift/obj/auditor.py b/swift/obj/auditor.py
index feef077..43d65b1 100644
--- a/swift/obj/auditor.py
+++ b/swift/obj/auditor.py
@@ -267,15 +267,15 @@ class AuditorWorker(object):
except DiskFileDeleted:
# If there is a tombstone, call get_hashes to cleanup and reclaim
ondisk_info_dict = df._ondisk_info
- ts = (ondisk_info_dict['ts_info']['timestamp']).internal
-
- if (time.time() - float(ts)) > self.reclaim_age:
- ts_file = ondisk_info_dict['ts_file']
- suffix_path = dirname(dirname(ts_file))
- suffix_dir = [basename(suffix_path)]
- diskfile_mgr.get_hashes(location.device, location.partition,
- suffix_dir,
- location.policy)
+
+ ts_file = ondisk_info_dict['ts_file']
+ suffix_path = dirname(ts_file)
+
+ diskfile_mgr.cleanup_ondisk_files(suffix_path, self.reclaim_age)
+ try:
+ os.rmdir(suffix_path)
+ except OSError:
+ pass
except DiskFileNotExist:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment