summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2016-11-17 17:07:36 +0530
committerVijay Bellur <vbellur@redhat.com>2016-11-22 11:33:37 -0800
commitecd6da0a754f21909dbbd8189228f5a27a15df3e (patch)
tree558bb3590ebf3f01cc5d26f8c73589b3240ddd97 /geo-replication
parentded44a2627e5421880ffcc798f2838f52faaf322 (diff)
geo-rep: Handle ENOENT during unlink
Do not raise traceback if a file/dir not exists during unlink or rmdir BUG: 1396062 Change-Id: Idd43ca1fa6ae6056c3cd493f0e2f151880a3968c Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/15868 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/resource.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/geo-replication/syncdaemon/resource.py b/geo-replication/syncdaemon/resource.py
index 0b756b750e7..8c490591849 100644
--- a/geo-replication/syncdaemon/resource.py
+++ b/geo-replication/syncdaemon/resource.py
@@ -818,11 +818,13 @@ class Server(object):
if st.st_ino == st1.st_ino:
# we have a hard link, we can now unlink source
try:
- os.unlink(entry)
+ errno_wrap(os.unlink, [entry],
+ [ENOENT, ESTALE])
except OSError as e:
if e.errno == EISDIR:
try:
- os.rmdir(entry)
+ errno_wrap(os.rmdir, [entry],
+ [ENOENT, ESTALE])
except OSError as e:
if e.errno == ENOTEMPTY:
logging.error(