diff options
author | Peter Portante <peter.portante@redhat.com> | 2013-07-15 16:52:46 -0400 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-08-21 19:38:35 -0700 |
commit | 9d4e67e741f13b4b93620fbb972886e1dc975fee (patch) | |
tree | b6862ed79251d46771f87bbc25791f8e8d1eb29e /gluster/swift/obj/server.py | |
parent | 54bb5bec7a025eecb51f85274ec37dbd0c478758 (diff) |
Updates to support Havana interim version 1.9.1.
The code changes are basically:
* Apply refactoring in the DiskFile class to use the new DiskWriter
abstraction
* Move and rename our diskfile module to match upstream
* ThreadPools allow us to remove the tpool usage around fsync
* Update the Ring subclass to support the get_part() method
* Update to use the 1.9.1 proxy server unit tests
* Move the DebugLogger class to test.unit
* Rebuild the Rings to use the new layout
* Remove backup ring builder files
* Update spec files to 1.9.1, and tox to use swift 1.9.1
* Updated version to 1.9.0-0
Change-Id: Ica12cac8b351627d67500723f1dbd8a54d45f7c8
Signed-off-by: Peter Portante <peter.portante@redhat.com>
Signed-off-by: Luis Pabon <lpabon@redhat.com>
Reviewed-on: http://review.gluster.org/5331
Diffstat (limited to 'gluster/swift/obj/server.py')
-rw-r--r-- | gluster/swift/obj/server.py | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/gluster/swift/obj/server.py b/gluster/swift/obj/server.py index b3747ab..bdd7687 100644 --- a/gluster/swift/obj/server.py +++ b/gluster/swift/obj/server.py @@ -13,20 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Object Server for Gluster Swift UFO """ +""" Object Server for Gluster for Swift """ # Simply importing this monkey patches the constraint handling to fit our # needs -from swift.obj import server -import gluster.swift.common.utils # noqa import gluster.swift.common.constraints # noqa -from swift.common.utils import public, timing_stats -from gluster.swift.common.DiskFile import Gluster_DiskFile -from gluster.swift.common.exceptions import DiskFileNoSpace -from swift.common.swob import HTTPInsufficientStorage -# Monkey patch the object server module to use Gluster's DiskFile definition -server.DiskFile = Gluster_DiskFile +from swift.obj import server + +from gluster.swift.obj.diskfile import DiskFile class ObjectController(server.ObjectController): @@ -37,6 +32,18 @@ class ObjectController(server.ObjectController): operations directly). """ + def _diskfile(self, device, partition, account, container, obj, **kwargs): + """Utility method for instantiating a DiskFile.""" + kwargs.setdefault('mount_check', self.mount_check) + kwargs.setdefault('bytes_per_sync', self.bytes_per_sync) + kwargs.setdefault('disk_chunk_size', self.disk_chunk_size) + kwargs.setdefault('threadpool', self.threadpools[device]) + kwargs.setdefault('obj_dir', server.DATADIR) + kwargs.setdefault('disallowed_metadata_keys', + server.DISALLOWED_HEADERS) + return DiskFile(self.devices, device, partition, account, + container, obj, self.logger, **kwargs) + def container_update(self, op, account, container, obj, request, headers_out, objdevice): """ @@ -56,15 +63,6 @@ class ObjectController(server.ObjectController): """ return - @public - @timing_stats() - def PUT(self, request): - try: - return server.ObjectController.PUT(self, request) - except DiskFileNoSpace as err: - drive = err.drive - return HTTPInsufficientStorage(drive=drive, request=request) - def app_factory(global_conf, **local_conf): """paste.deploy app factory for creating WSGI object server apps""" |