diff --git a/swiftonfile/swift/common/fs_utils.py b/swiftonfile/swift/common/fs_utils.py index 6a220f8..be96d1d 100644 --- a/swiftonfile/swift/common/fs_utils.py +++ b/swiftonfile/swift/common/fs_utils.py @@ -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): diff --git a/swiftonfile/swift/common/utils.py b/swiftonfile/swift/common/utils.py index eeda8e9..ec5e007 100644 --- a/swiftonfile/swift/common/utils.py +++ b/swiftonfile/swift/common/utils.py @@ -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