summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2018-09-28 13:02:03 -0700
committerTim Burke <tim.burke@gmail.com>2018-09-28 13:06:52 -0700
commit93fb77e8afc25d5fe1452aca530ad5997bc891fd (patch)
tree10c38e26f160e82f795cccdcf9b0ae24bee0c7b3
parent07e25b8698ad3580c1532226f4fa6e7b25ad0a21 (diff)
downloadswift-93fb77e8afc25d5fe1452aca530ad5997bc891fd.tar.gz
Ignore ENOENT and ENOTEMPTY errors in delete_partition
This is comparable to the error handling we have in delete_handoff_objs. Change-Id: I08bda9bcfeb60b3c5654322a9e6139a8ac5b3391
-rw-r--r--swift/obj/replicator.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/swift/obj/replicator.py b/swift/obj/replicator.py
index a66b5f477..9dc7c925e 100644
--- a/swift/obj/replicator.py
+++ b/swift/obj/replicator.py
@@ -576,7 +576,12 @@ class ObjectReplicator(Daemon):
def delete_partition(self, path):
self.logger.info(_("Removing partition: %s"), path)
- tpool.execute(shutil.rmtree, path)
+ try:
+ tpool.execute(shutil.rmtree, path)
+ except OSError as e:
+ if e.errno not in (errno.ENOENT, errno.ENOTEMPTY):
+ # If there was a race to create or delete, don't worry
+ raise
def delete_handoff_objs(self, job, delete_objs):
success_paths = []