From 286a1308db72c5cfdd6ce16aff3f291ebce257c2 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Thu, 24 Oct 2013 16:15:25 -0400 Subject: Rebase to OpenStack Swift Havana (1.10.0) Change-Id: I90821230a1a7100c74d97cccc9c445251d0f65e7 Signed-off-by: Peter Portante Reviewed-on: http://review.gluster.org/6157 Reviewed-by: Luis Pabon Tested-by: Luis Pabon --- gluster/swift/common/fs_utils.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'gluster/swift/common/fs_utils.py') diff --git a/gluster/swift/common/fs_utils.py b/gluster/swift/common/fs_utils.py index afc0cfe..8b26fd0 100644 --- a/gluster/swift/common/fs_utils.py +++ b/gluster/swift/common/fs_utils.py @@ -32,7 +32,7 @@ class Fake_file(object): return 0 def read(self, count): - return 0 + return None def fileno(self): return -1 @@ -265,6 +265,14 @@ def do_fsync(fd): err.errno, '%s, os.fsync("%s")' % (err.strerror, fd)) +def do_fdatasync(fd): + try: + os.fdatasync(fd) + except OSError as err: + raise GlusterFileSystemOSError( + err.errno, '%s, os.fdatasync("%s")' % (err.strerror, fd)) + + def mkdirs(path): """ Ensures the path is a directory or makes it if not. Errors if the path -- cgit