From 81623cfa2c4142ebf6ba34721269d8f5fc90e058 Mon Sep 17 00:00:00 2001 From: Peter Portante Date: Tue, 14 May 2013 12:02:59 -0400 Subject: [PATCH] Perform mount check after REST params valid on PUT All the other methods (POST, GET, HEAD, DELETE and REPLICATE) first validate the REST parameters and headers before performing the mount check. Do the same for PUT. Change-Id: I6e5f34cc65b57662b7f88224ca0e1501787e0f43 Signed-off-by: Peter Portante --- swift/obj/server.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swift/obj/server.py b/swift/obj/server.py index 79ca08fce0..6bbe8740b6 100644 --- a/swift/obj/server.py +++ b/swift/obj/server.py @@ -661,8 +661,6 @@ class ObjectController(object): except ValueError, err: return HTTPBadRequest(body=str(err), request=request, content_type='text/plain') - if self.mount_check and not check_mount(self.devices, device): - return HTTPInsufficientStorage(drive=device, request=request) if 'x-timestamp' not in request.headers or \ not check_float(request.headers['x-timestamp']): return HTTPBadRequest(body='Missing timestamp', request=request, @@ -674,6 +672,8 @@ class ObjectController(object): if new_delete_at and new_delete_at < time.time(): return HTTPBadRequest(body='X-Delete-At in past', request=request, content_type='text/plain') + if self.mount_check and not check_mount(self.devices, device): + return HTTPInsufficientStorage(drive=device, request=request) disk_file = DiskFile(self.devices, device, partition, account, container, obj, self.logger, disk_chunk_size=self.disk_chunk_size)