Commit 17cf6a79 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

fix deletion

parent a808bfc6
......@@ -183,8 +183,7 @@ class PithosTargetHandle(object):
del_name = self.mk_del_name(objname, etag)
logger.info("Moving temporarily to '%s'" % del_name)
self._move_object(objname, etag, del_name)
self.endpoint.del_object(del_name)
logger.info("Deleted tmp '%s'" % del_name)
self._del_object(del_name)
def _move_object(self, objname, etag, del_name):
container = self.endpoint.container
......@@ -199,6 +198,16 @@ class PithosTargetHandle(object):
else:
raise
def _del_object(self, del_name):
try:
self.endpoint.del_object(del_name)
logger.info("Deleted tmp '%s'" % del_name)
except ClientError as e:
if e.status == 404:
logger.warning("'%s' not found; already deleted?" % del_name)
else:
raise
def directory_put(self, objname, etag):
if_etag_not_match = '*' if not(etag) else None
r = self.endpoint.object_put(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment