summaryrefslogtreecommitdiffstats
path: root/ufo/gluster/swift/common/DiskDir.py
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-02-09 04:37:28 +0530
committerAnand Avati <avati@redhat.com>2013-02-11 18:00:56 -0800
commit311a5df884c0d2320dd43191e6e6ba0a033eb683 (patch)
tree5dfc1e91ba79565ce735453afb8d2d24d635501f /ufo/gluster/swift/common/DiskDir.py
parent3b19a14b86f753a0465a11a89eaabf3e19f42eca (diff)
object-storage: Use the wrapper functions provided by fs_utils.py to make
system calls. The set of changes: * Unit test cases for fs_utils.py * Replaced os.path with os_path * Implemented wrapper functions do_write, do_chmod, etc in fs_utils.py * Replaced os.<sys-call> with the wrapper functions. Change-Id: I770da878e83eda6b98e49d70193990406a2642a7 BUG: 887301 Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/4360 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'ufo/gluster/swift/common/DiskDir.py')
-rw-r--r--ufo/gluster/swift/common/DiskDir.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ufo/gluster/swift/common/DiskDir.py b/ufo/gluster/swift/common/DiskDir.py
index eb854f88240..18d08cc0f16 100644
--- a/ufo/gluster/swift/common/DiskDir.py
+++ b/ufo/gluster/swift/common/DiskDir.py
@@ -22,7 +22,7 @@ from gluster.swift.common.utils import clean_metadata, dir_empty, rmdirs, \
DEFAULT_UID, validate_object, create_object_metadata, read_metadata, \
write_metadata, X_CONTENT_TYPE, X_CONTENT_LENGTH, X_TIMESTAMP, \
X_PUT_TIMESTAMP, X_TYPE, X_ETAG, X_OBJECTS_COUNT, X_BYTES_USED, \
- X_CONTAINER_COUNT, CONTAINER
+ X_CONTAINER_COUNT, CONTAINER, os_path
from gluster.swift.common import Glusterfs
from swift.common.constraints import CONTAINER_LISTING_LIMIT
@@ -69,7 +69,7 @@ def _read_metadata(dd):
class DiskCommon(object):
def is_deleted(self):
- return not os.path.exists(self.datadir)
+ return not os_path.exists(self.datadir)
def filter_prefix(self, objects, prefix):
"""
@@ -170,7 +170,7 @@ class DiskDir(DiskCommon):
self.uid = int(uid)
self.gid = int(gid)
self.db_file = _db_file
- self.dir_exists = os.path.exists(self.datadir)
+ self.dir_exists = os_path.exists(self.datadir)
if self.dir_exists:
try:
self.metadata = _read_metadata(self.datadir)
@@ -201,7 +201,7 @@ class DiskDir(DiskCommon):
def delete(self):
if self.empty():
#For delete account.
- if os.path.ismount(self.datadir):
+ if os_path.ismount(self.datadir):
clean_metadata(self.datadir)
else:
rmdirs(self.datadir)
@@ -387,7 +387,7 @@ class DiskDir(DiskCommon):
"""
Create the container if it doesn't exist and update the timestamp
"""
- if not os.path.exists(self.datadir):
+ if not os_path.exists(self.datadir):
self.put(self.metadata)
def delete_object(self, name, timestamp):