Skip to content

Instantly share code, notes, and snippets.

@clayg
Created July 31, 2015 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayg/1e8cbd0b90eb66eb3ae0 to your computer and use it in GitHub Desktop.
Save clayg/1e8cbd0b90eb66eb3ae0 to your computer and use it in GitHub Desktop.
diff --git a/swift/obj/server.py b/swift/obj/server.py
index 8d61b86..56cc21f 100644
--- a/swift/obj/server.py
+++ b/swift/obj/server.py
@@ -832,7 +832,7 @@ class ObjectController(BaseStorageServer):
# if we can not verify the x-if-delete-at time
if not orig_timestamp:
# no object found at all
- return HTTPNotFound()
+ return HTTPNotFound(request=request)
if orig_delete_at != req_if_delete_at:
return HTTPPreconditionFailed(
request=request,
diff --git a/test/unit/common/test_swob.py b/test/unit/common/test_swob.py
index 727843e..ebfec2e 100644
--- a/test/unit/common/test_swob.py
+++ b/test/unit/common/test_swob.py
@@ -1407,16 +1407,14 @@ class TestResponse(unittest.TestCase):
self.assertEquals(resp.host_url, 'https://someother:5678')
def test_507(self):
- req = swift.common.swob.Request.blank('/')
- resp = swift.common.swob.HTTPInsufficientStorage(request=req)
- content = ''.join(resp._response_iter(resp.app_iter, resp._body))
+ resp = swift.common.swob.HTTPInsufficientStorage()
+ content = ''.join(resp({}, lambda *args: None))
self.assertEquals(
content,
'<html><h1>Insufficient Storage</h1><p>There was not enough space '
'to save the resource. Drive: unknown</p></html>')
- resp = swift.common.swob.HTTPInsufficientStorage(request=req,
- drive='sda1')
- content = ''.join(resp._response_iter(resp.app_iter, resp._body))
+ resp = swift.common.swob.HTTPInsufficientStorage(drive='sda1')
+ content = ''.join(resp({}, lambda *args: None))
self.assertEquals(
content,
'<html><h1>Insufficient Storage</h1><p>There was not enough space '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment