diff options
author | Chetan Risbud <crisbud@redhat.com> | 2013-07-31 19:36:32 +0530 |
---|---|---|
committer | Luis Pabon <lpabon@redhat.com> | 2013-08-13 12:34:48 -0700 |
commit | 32ce873516af0baf76cfb9fea831434b672f3516 (patch) | |
tree | 3075eadd43a1105fd10033550ea37557f6f59418 /gluster/swift/obj/server.py | |
parent | f54f00dc313d52414230e3c05dfa383ad7e7a8ce (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>
Reviewed-on: http://review.gluster.org/5570
Diffstat (limited to 'gluster/swift/obj/server.py')
-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""" |