)]}'
{"glance/tests/unit/test_swift_store.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"bb188ccce6669fc4a82ae6a017a516854f68b939","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        image_swift \u003d StringIO.StringIO(\"nevergonnamakeit\")"},{"line_number":409,"context_line":"        self.assertRaises(exception.Duplicate,"},{"line_number":410,"context_line":"                          self.store.add,"},{"line_number":411,"context_line":"                          FAKE_UUID, image_swift, len(image_swift.read()))"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def _option_required(self, key):"},{"line_number":414,"context_line":"        options \u003d SWIFT_OPTIONS.copy()"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAC3%2F%2F%2B58%3D","line":411,"updated":"2011-12-06 16:31:48.000000000","message":"OK, so it should not matter what the value of the image_size parameter is here. It should raise Duplicate because an image with ID of FAKE_UUID has already been added to Swift.\n\nSo, this is actually an indication that something is not quite working properly in the fake Swift driver methods in the unit test test_swift_store.py.\n\nLooking at that fake driver, I found the source of the problem is the fake_put_object() method. There is a block like this:\n\n        if kwargs.get(\u0027headers\u0027):\n            etag \u003d kwargs[\u0027headers\u0027][\u0027ETag\u0027]\n            fixture_headers[fixture_key] \u003d {\u0027manifest\u0027: True,\n                                            \u0027etag\u0027: etag}\n            return etag\n\nThat block handles the putting of the \"manifest\" object. That block needs to be put inside the if block below it that checks for previous existence of a key:\n\n        if not fixture_key in fixture_headers.keys():\n\nThe else block for the above is what raises the required Duplicate exception.\n\nHope that makes sense!\n-jay","commit_id":"d4b46b2a2bdc9ae8beaea2a8ae58f3ebe7d668b3"}]}
