summaryrefslogtreecommitdiffstats
path: root/gluster/swift/obj/server.py
diff options
context:
space:
mode:
Diffstat (limited to 'gluster/swift/obj/server.py')
-rw-r--r--gluster/swift/obj/server.py17
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"""