diff options
author | Aravinda VK <avishwan@redhat.com> | 2016-11-17 17:07:36 +0530 |
---|---|---|
committer | Aravinda VK <avishwan@redhat.com> | 2016-12-02 00:21:47 -0800 |
commit | a70306805d1f1ce21c1c718c3532731d3ca4184a (patch) | |
tree | af10c84c08902dca61e2eabb4b2613ac17e02482 | |
parent | b80e1c607b3d3aeaea2f929716b676918dc74cad (diff) |
geo-rep: Handle ENOENT during unlink
Do not raise traceback if a file/dir not exists during
unlink or rmdir
> 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>
BUG: 1399092
Change-Id: Idd43ca1fa6ae6056c3cd493f0e2f151880a3968c
Signed-off-by: Aravinda VK <avishwan@redhat.com>
(cherry picked from commit ecd6da0a754f21909dbbd8189228f5a27a15df3e)
Reviewed-on: http://review.gluster.org/15940
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Saravanakumar Arumugam <sarumuga@redhat.com>
-rw-r--r-- | geo-replication/syncdaemon/resource.py | 6 |
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( |