summaryrefslogtreecommitdiffstats
path: root/gluster
diff options
context:
space:
mode:
authorLuis Pabon <lpabon@redhat.com>2013-11-20 15:51:55 -0500
committerLuis Pabon <lpabon@redhat.com>2013-11-21 05:06:33 -0800
commitb46dc3ae9c500ec64b9a7f00c804152fa8e67ef8 (patch)
treead5ae27195034415f466b2f7602e346dc1091c26 /gluster
parent3f504879c4a41fa688e5f3d336c8f5f9f9d3f49a (diff)
Log only non-ENOENT errors in diskfile
DiskFile.open() gets called for every PUT. The expected sideeffect is that if the file exists, the metadata in the object will be populated. DiskFile.open() was logging any errors it detected while trying to open() the file. Issue is that when we PUT a new file, there is no entry, and open() will return an error. The was incorrectly logging each one of these errors. Change-Id: I7d721df177761066fdaa46d278fff2d779924999 Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/6316 Reviewed-by: Thiago Da Silva <thiago@redhat.com> Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Prashanth Pai <ppai@redhat.com>
Diffstat (limited to 'gluster')
-rw-r--r--gluster/swift/obj/diskfile.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gluster/swift/obj/diskfile.py b/gluster/swift/obj/diskfile.py
index f74e329..41fe6c6 100644
--- a/gluster/swift/obj/diskfile.py
+++ b/gluster/swift/obj/diskfile.py
@@ -557,8 +557,9 @@ class DiskFile(SwiftDiskFile):
try:
fd = do_open(data_file, os.O_RDONLY | os.O_EXCL)
except GlusterFileSystemOSError as err:
- self.logger.exception(
- "Error opening file, %s :: %s", data_file, err)
+ if err.errno != errno.ENOENT:
+ self.logger.exception(
+ "Error opening file, %s :: %s", data_file, err)
else:
try:
stats = do_fstat(fd)