Merge "Ignore ENOENT and ENOTEMPTY errors in delete_partition"
This commit is contained in:
@@ -576,7 +576,12 @@ class ObjectReplicator(Daemon):
|
|||||||
|
|
||||||
def delete_partition(self, path):
|
def delete_partition(self, path):
|
||||||
self.logger.info(_("Removing partition: %s"), 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):
|
def delete_handoff_objs(self, job, delete_objs):
|
||||||
success_paths = []
|
success_paths = []
|
||||||
|
|||||||
Reference in New Issue
Block a user