diff options
author | Chetan Risbud <crisbud@redhat.com> | 2013-07-31 19:36:32 +0530 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-08-06 03:50:59 -0700 |
commit | 027951c1022739a8d53379048349ac2391763d6b (patch) | |
tree | f4db8d53666d339a46317328e463817748606fdf /gluster/swift/obj | |
parent | e367372f8b556d62ba2f87c6cb36347ae934d70e (diff) |
Gluster to handle ENOSPC (Error 28) correctly
A gluster volume could yield an ENOSPC condition seeing
that a volume is full. This needed to handled correctly.
Added error handling.
BUG: 985253
https://bugzilla.redhat.com/show_bug.cgi?id=985253
Change-Id: I85472c0a81a354a2796327fead606da3a938d4bf
Signed-off-by: Chetan Risbud <crisbud@redhat.com>
Reviewed-on: http://review.gluster.org/5362
Reviewed-by: Peter Portante <pportant@redhat.com>
Reviewed-by: Luis Pabon <lpabon@redhat.com>
Tested-by: Luis Pabon <lpabon@redhat.com>
Diffstat (limited to 'gluster/swift/obj')
-rw-r--r-- | gluster/swift/obj/server.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gluster/swift/obj/server.py b/gluster/swift/obj/server.py index e7b9ff3..b3747ab 100644 --- a/gluster/swift/obj/server.py +++ b/gluster/swift/obj/server.py @@ -17,11 +17,13 @@ # Simply importing this monkey patches the constraint handling to fit our # needs -import gluster.swift.common.constraints # noqa -import gluster.swift.common.utils # noqa - 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 @@ -54,6 +56,15 @@ 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""" |