diff options
author | Peter Portante <peter.portante@redhat.com> | 2012-11-08 01:16:56 -0500 |
---|---|---|
committer | Peter Portante <peter.portante@redhat.com> | 2013-04-29 16:35:56 -0400 |
commit | dd826e28c7b34603771d5652574a8df235637380 (patch) | |
tree | f9900d838bb0c6e31cc00816f39edd11ff3eb236 /swift/1.4.8/gluster/swift/container/server.py | |
parent | b85ce6f7e1513cd53a5adce7942a469fc96d38f3 (diff) |
object-storage: final changes to remove swift diff
Final set of changes to remove the diffs carried to make UFO work with
OpenStack Swift. The code is now a complete layering on top of OpenStack Swift
where we either "monkey patch" or subclass as necessary.
See BZ 870589 (https://bugzilla.redhat.com/show_bug.cgi?id=870589).
There are a lot of changes here due for the most part to rearranging the
directory hierarchy to have create a proper python module hierarchy under the
"gluster" namespace. Plugin references have been removed. The differences that
used to be in the swift.diff file are now replaced with server implementations
for account, container, object, and proxy that subclass the swift versions.
Additionally, the plugins/conf directory has been moved to the "etc"
directory, and the plugins/bin directory promoted a level.
Unit tests pass.
A new setup.py file is provided so that the install process can use it for
creating all the necessary python install infrastructure (eggs and paste
support).
A new RPM spec file is provided which to properly install the new code, and
the sample configuration files have been modified to reference the new python
egg.
Change-Id: I4316c1b66dca80f847fe9b0d583174689c175599
BUG: 870589
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Reviewed-on: http://review.gluster.org/4180
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Mohammed Junaid <junaid@redhat.com>
Tested-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'swift/1.4.8/gluster/swift/container/server.py')
-rw-r--r-- | swift/1.4.8/gluster/swift/container/server.py | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/swift/1.4.8/gluster/swift/container/server.py b/swift/1.4.8/gluster/swift/container/server.py new file mode 100644 index 0000000..e2a1973 --- /dev/null +++ b/swift/1.4.8/gluster/swift/container/server.py @@ -0,0 +1,46 @@ +# Copyright (c) 2012 Red Hat, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +""" Container Server for Gluster Swift UFO """ + +# Simply importing this monkey patches the constraint handling to fit our +# needs +import gluster.swift.common.constraints + +from swift.container import server +from gluster.swift.common.DiskDir import DiskDir + + +class ContainerController(server.ContainerController): + def _get_container_broker(self, drive, part, account, container): + """ + Overriden to provide the GlusterFS specific broker that talks to + Gluster for the information related to servicing a given request + instead of talking to a database. + + :param drive: drive that holds the container + :param part: partition the container is in + :param account: account name + :param container: container name + :returns: DiskDir object + """ + return DiskDir(self.root, account, container, self.logger) + + +def app_factory(global_conf, **local_conf): + """paste.deploy app factory for creating WSGI container server apps.""" + conf = global_conf.copy() + conf.update(local_conf) + return ContainerController(conf) |