Created
September 2, 2016 11:37
-
-
Save MahatiC/f64ae7c08f5897ebe43415677486ed3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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