diff options
author | Luis Pabon <lpabon@redhat.com> | 2013-05-29 21:19:43 -0400 |
---|---|---|
committer | Peter Portante <pportant@redhat.com> | 2013-06-03 16:52:15 -0700 |
commit | 40c313378e5fffb846f1fd143573a687e2774b28 (patch) | |
tree | dc6dd6e05c8a4abe1eba31bc25f849c86df8be96 /gluster/swift/common/DiskDir.py | |
parent | 31a2ef1935133f224169a1315a91a2d9e9775d9a (diff) |
Copy proxy unit test from OpenStack Swift
This is a copy of the proxy unit test from OpenStack
Swift. The file has minor changes to make it compatible
with Gluster For Swift.
Change-Id: I64a0f8d274461eb2a2c38524c6282e0d3d3d1457
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/5113
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'gluster/swift/common/DiskDir.py')
-rw-r--r-- | gluster/swift/common/DiskDir.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gluster/swift/common/DiskDir.py b/gluster/swift/common/DiskDir.py index 36d8b79..a0c9a51 100644 --- a/gluster/swift/common/DiskDir.py +++ b/gluster/swift/common/DiskDir.py @@ -30,9 +30,7 @@ from gluster.swift.common import Glusterfs DATADIR = 'containers' # Create a dummy db_file in Glusterfs.RUN_DIR -_db_file = os.path.join(Glusterfs.RUN_DIR, 'db_file.db') -if not os.path.exists(_db_file): - file(_db_file, 'w+') +_db_file = "" def _read_metadata(dd): @@ -224,6 +222,12 @@ class DiskDir(DiskCommon): self.container_info = None self.uid = int(uid) self.gid = int(gid) + # Create a dummy db_file in Glusterfs.RUN_DIR + global _db_file + if not _db_file: + _db_file = os.path.join(Glusterfs.RUN_DIR, 'db_file.db') + if not os.path.exists(_db_file): + file(_db_file, 'w+') self.db_file = _db_file self.dir_exists = os_path.exists(self.datadir) if self.dir_exists: @@ -468,6 +472,10 @@ class DiskAccount(DiskDir): super(DiskAccount, self).__init__(root, drive, account, None, logger) assert self.dir_exists + def is_status_deleted(self): + """Only returns true if the status field is set to DELETED.""" + return False + def initialize(self, timestamp): """ Create and write metatdata to directory/account. |