Merge "Cleanup exception logging"

This commit is contained in:
Jenkins 2015-07-07 09:54:27 +00:00 committed by Gerrit Code Review
commit 780e697e2f
2 changed files with 9 additions and 6 deletions

View File

@ -65,7 +65,7 @@ def do_read(fd, n):
buf = os.read(fd, n)
except OSError as err:
raise SwiftOnFileSystemOSError(
err.errno, '%s, os.write("%s", ...)' % (err.strerror, fd))
err.errno, '%s, os.read("%s", ...)' % (err.strerror, fd))
return buf
@ -247,7 +247,7 @@ def do_fdatasync(fd):
do_fsync(fd)
except OSError as err:
raise SwiftOnFileSystemOSError(
err.errno, '%s, os.fsync("%s")' % (err.strerror, fd))
err.errno, '%s, os.fdatasync("%s")' % (err.strerror, fd))
_posix_fadvise = None
@ -267,7 +267,7 @@ def do_lseek(fd, pos, how):
os.lseek(fd, pos, how)
except OSError as err:
raise SwiftOnFileSystemOSError(
err.errno, '%s, os.fsync("%s")' % (err.strerror, fd))
err.errno, '%s, os.lseek("%s")' % (err.strerror, fd))
def get_filename_from_fd(fd, verify=False):

View File

@ -96,7 +96,8 @@ def read_metadata(path_or_fd):
# Note that we don't touch the keys on errors fetching the
# data since it could be a transient state.
raise SwiftOnFileSystemIOError(
err.errno, 'getxattr("%s", %s)' % (path_or_fd, key))
err.errno, '%s, getxattr("%s", %s)' % (err.strerror,
path_or_fd, key))
else:
try:
# If this key provides all or the remaining part of the pickle
@ -143,7 +144,8 @@ def write_metadata(path_or_fd, metadata):
else:
raise SwiftOnFileSystemIOError(
err.errno,
'setxattr("%s", %s, metastr)' % (path_or_fd, key))
'%s, setxattr("%s", %s, metastr)' % (err.strerror,
path_or_fd, key))
metastr = metastr[MAX_XATTR_SIZE:]
key += 1
@ -157,7 +159,8 @@ def clean_metadata(path_or_fd):
if err.errno == errno.ENODATA:
break
raise SwiftOnFileSystemIOError(
err.errno, 'removexattr("%s", %s)' % (path_or_fd, key))
err.errno, '%s, removexattr("%s", %s)' % (err.strerror,
path_or_fd, key))
key += 1