summaryrefslogtreecommitdiffstats
path: root/ufo/gluster/swift
diff options
context:
space:
mode:
authorPeter Portante <peter.portante@redhat.com>2012-11-21 16:42:15 -0500
committerAnand Avati <avati@redhat.com>2012-12-06 22:51:29 -0800
commita8d59075bfff1428c34ade2ad2e13fa51e3f6dbb (patch)
tree1bb143c23d012301e5425e92dad64d165b0d22be /ufo/gluster/swift
parentefbc6349251ef32df8c5f670f550a0aaec8400f5 (diff)
object-storage: fix account mapping
Fix the account mapping so that we always use what is provided by the request. With this fix, "/mnt/gluster-object/AUTH_ufo0" directory hierachies won't be created. But this fix does not restore the one-to-one account to gluster volume name mapping. When the user runs the /usr/bin/gluster-swift-gen-builders script, it still only allows one cluster volume, and that is the only volume that is used. So the account names are effectively ignored. A future set of changes will address that problem. Change-Id: I2df608de2f00fd356a09c500d49fe12cc1a0a574 BUG: 870589 Signed-off-by: Peter Portante <peter.portante@redhat.com> Reviewed-on: http://review.gluster.org/4222 Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com> Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com> Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Diffstat (limited to 'ufo/gluster/swift')
-rw-r--r--ufo/gluster/swift/account/server.py2
-rw-r--r--ufo/gluster/swift/common/DiskDir.py13
-rw-r--r--ufo/gluster/swift/common/DiskFile.py1
-rw-r--r--ufo/gluster/swift/container/server.py2
4 files changed, 8 insertions, 10 deletions
diff --git a/ufo/gluster/swift/account/server.py b/ufo/gluster/swift/account/server.py
index 8b98315790a..aeaabc94238 100644
--- a/ufo/gluster/swift/account/server.py
+++ b/ufo/gluster/swift/account/server.py
@@ -35,7 +35,7 @@ class AccountController(server.AccountController):
:param account: account name
:returns: DiskDir object
"""
- return DiskAccount(self.root, account, self.logger)
+ return DiskAccount(self.root, drive, account, self.logger)
def app_factory(global_conf, **local_conf):
diff --git a/ufo/gluster/swift/common/DiskDir.py b/ufo/gluster/swift/common/DiskDir.py
index 8602fabae83..1e6a552b818 100644
--- a/ufo/gluster/swift/common/DiskDir.py
+++ b/ufo/gluster/swift/common/DiskDir.py
@@ -142,6 +142,7 @@ class DiskDir(DiskCommon):
Manage object files on disk.
:param path: path to devices on the node
+ :param drive: gluster volume drive name
:param account: account name for the object
:param container: container name for the object
:param logger: account or container server logging object
@@ -149,7 +150,7 @@ class DiskDir(DiskCommon):
:param gid: group ID container object should assume
"""
- def __init__(self, path, account, container, logger,
+ def __init__(self, path, drive, account, container, logger,
uid=DEFAULT_UID, gid=DEFAULT_GID):
self.root = path
if container:
@@ -157,11 +158,9 @@ class DiskDir(DiskCommon):
else:
self.container = None
if self.container:
- self.datadir = os.path.join(path, account, self.container)
+ self.datadir = os.path.join(path, drive, self.container)
else:
- self.datadir = os.path.join(path, account)
- # Note that the account name has a one-to-one mapping to the gluster
- # mount point, or volume name.
+ self.datadir = os.path.join(path, drive)
self.account = account
assert logger is not None
self.logger = logger
@@ -415,8 +414,8 @@ class DiskDir(DiskCommon):
class DiskAccount(DiskDir):
- def __init__(self, root, account, logger):
- super(DiskAccount, self).__init__(root, account, None, logger)
+ def __init__(self, root, drive, account, logger):
+ super(DiskAccount, self).__init__(root, drive, account, None, logger)
assert self.dir_exists
def list_containers_iter(self, limit, marker, end_marker,
diff --git a/ufo/gluster/swift/common/DiskFile.py b/ufo/gluster/swift/common/DiskFile.py
index 6404be6d68f..ddb53ed4201 100644
--- a/ufo/gluster/swift/common/DiskFile.py
+++ b/ufo/gluster/swift/common/DiskFile.py
@@ -57,7 +57,6 @@ class Gluster_DiskFile(DiskFile):
logger, keep_data_fp=False, disk_chunk_size=65536,
uid=DEFAULT_UID, gid=DEFAULT_GID):
self.disk_chunk_size = disk_chunk_size
- device = account
#Don't support obj_name ending/begining with '/', like /a, a/, /a/b/ etc
obj = obj.strip('/')
if '/' in obj:
diff --git a/ufo/gluster/swift/container/server.py b/ufo/gluster/swift/container/server.py
index e2a19730220..c5792aaa289 100644
--- a/ufo/gluster/swift/container/server.py
+++ b/ufo/gluster/swift/container/server.py
@@ -36,7 +36,7 @@ class ContainerController(server.ContainerController):
:param container: container name
:returns: DiskDir object
"""
- return DiskDir(self.root, account, container, self.logger)
+ return DiskDir(self.root, drive, account, container, self.logger)
def app_factory(global_conf, **local_conf):