summaryrefslogtreecommitdiffstats
path: root/gluster/swift/common/fs_utils.py
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2013-10-24 16:15:25 -0400
committerLuis Pabon <lpabon@redhat.com>2013-10-28 11:51:51 -0700
commit286a1308db72c5cfdd6ce16aff3f291ebce257c2 (patch)
treeaabb3c54a29d6236f5ade0a229c477378a6c832c /gluster/swift/common/fs_utils.py
parent6b8d7c59195327484ac0f14bd1c29e4f75415e3b (diff)
Rebase to OpenStack Swift Havana (1.10.0)
Change-Id: I90821230a1a7100c74d97cccc9c445251d0f65e7 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/6157 Reviewed-by: Luis Pabon <lpabon@redhat.com> Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/common/fs_utils.py')
-rw-r--r--gluster/swift/common/fs_utils.py10
1 files changed, 9 insertions, 1 deletions
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