From b46dc3ae9c500ec64b9a7f00c804152fa8e67ef8 Mon Sep 17 00:00:00 2001 From: Luis Pabon Date: Wed, 20 Nov 2013 15:51:55 -0500 Subject: 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 Reviewed-on: http://review.gluster.org/6316 Reviewed-by: Thiago Da Silva Reviewed-by: Peter Portante Tested-by: Prashanth Pai --- gluster/swift/obj/diskfile.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gluster/swift') 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) -- cgit