)]}'
{"glance/api/v1/images.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9975577c183c5300f15dc7c4f2e9a8cd80922433","unresolved":false,"context_lines":[{"line_number":248,"context_line":"            self.get_store_or_400(req, store)"},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"            # retrieve the image size from remote store (if not provided)"},{"line_number":251,"context_line":"            image_meta[\u0027size\u0027] \u003d image_meta.get(\u0027size\u0027, 0) \\"},{"line_number":252,"context_line":"                                 or get_size_from_backend(location)"},{"line_number":253,"context_line":"        else:"},{"line_number":254,"context_line":"            # Ensure that the size attribute is set to zero for uploadable"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAD3%2F%2F8xc%3D","line":251,"updated":"2012-01-19 01:19:33.000000000","message":"You don\u0027t need to explicitly default to 0 here, since None will cause the same result.","commit_id":"3956c546fb725a13784f6e1441a74be1680abd9d"}],"glance/store/__init__.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f4eab6d0f4df774ea4873ec8fb813d6f9c2b519","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    return store.get(loc)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"def size_from_backend(uri):"},{"line_number":135,"context_line":"    \"\"\"Retrieves image size from backend specified by uri\"\"\""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    store \u003d get_store_from_uri(uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F87I%3D","line":134,"updated":"2012-01-18 19:42:19.000000000","message":"Could we call this method get_size_from_backend() just to make it consistent with the other getter methods?","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"425cdffab4d1640466c26dfb404492e7bf8b2e46","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    return store.get(loc)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"def size_from_backend(uri):"},{"line_number":135,"context_line":"    \"\"\"Retrieves image size from backend specified by uri\"\"\""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    store \u003d get_store_from_uri(uri)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F83k%3D","line":134,"in_reply_to":"AAAAD3%2F%2F87I%3D","updated":"2012-01-18 21:34:41.000000000","message":"Sure, done.","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"}],"glance/store/base.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f4eab6d0f4df774ea4873ec8fb813d6f9c2b519","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\""},{"line_number":77,"context_line":"        raise NotImplementedError"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def size(self, location):"},{"line_number":80,"context_line":"        \"\"\""},{"line_number":81,"context_line":"        Takes a `glance.store.location.Location` object that indicates"},{"line_number":82,"context_line":"        where to find the image file, and returns the size"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F87E%3D","line":79,"updated":"2012-01-18 19:42:19.000000000","message":"Can we rename this to get_size()?","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"425cdffab4d1640466c26dfb404492e7bf8b2e46","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        \"\"\""},{"line_number":77,"context_line":"        raise NotImplementedError"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def size(self, location):"},{"line_number":80,"context_line":"        \"\"\""},{"line_number":81,"context_line":"        Takes a `glance.store.location.Location` object that indicates"},{"line_number":82,"context_line":"        where to find the image file, and returns the size"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F83g%3D","line":79,"in_reply_to":"AAAAD3%2F%2F87E%3D","updated":"2012-01-18 21:34:41.000000000","message":"Done.","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"}],"glance/store/http.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f4eab6d0f4df774ea4873ec8fb813d6f9c2b519","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        :param location `glance.store.location.Location` object, supplied"},{"line_number":128,"context_line":"                        from glance.store.location.get_location_from_uri()"},{"line_number":129,"context_line":"        :raises `glance.exception.NotFound` if image does not exist"},{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F868%3D","line":129,"updated":"2012-01-18 19:42:19.000000000","message":"I don\u0027t see this method raising a NotFound if the image does not exist?","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"425cdffab4d1640466c26dfb404492e7bf8b2e46","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        :param location `glance.store.location.Location` object, supplied"},{"line_number":128,"context_line":"                        from glance.store.location.get_location_from_uri()"},{"line_number":129,"context_line":"        :raises `glance.exception.NotFound` if image does not exist"},{"line_number":130,"context_line":"        \"\"\""},{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F83o%3D","line":129,"in_reply_to":"AAAAD3%2F%2F868%3D","updated":"2012-01-18 21:34:41.000000000","message":"True that, copy\u0027n\u0027paste looseness, removed in Patch Set 2.","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f4eab6d0f4df774ea4873ec8fb813d6f9c2b519","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":133,"context_line":"        except:"},{"line_number":134,"context_line":"            return 0"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _query(self, location, verb):"},{"line_number":137,"context_line":"        loc \u003d location.store_location"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F860%3D","line":134,"updated":"2012-01-18 19:42:19.000000000","message":"I\u0027m not sure that returning 0 is the right thing to do here. I\u0027m wondering if raising an exception is more appropriate, since knowing the image size is pretty critical for Glance. Thoughts?","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"425cdffab4d1640466c26dfb404492e7bf8b2e46","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        try:"},{"line_number":132,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":133,"context_line":"        except:"},{"line_number":134,"context_line":"            return 0"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _query(self, location, verb):"},{"line_number":137,"context_line":"        loc \u003d location.store_location"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F83s%3D","line":134,"in_reply_to":"AAAAD3%2F%2F860%3D","updated":"2012-01-18 21:34:41.000000000","message":"Well the \u0027best effort\u0027 semantics of the HEAD request was intended to keep the current (intended/unintended?) feature that the remote location need not actually be accessible when the image is added to glance.\n\nSo currently if I specify a an X-Image-Meta-Image-Location for a not-yet-existing S3 bucket or Swift container, or referencing an HTTP server not currently running, it will not fail until the image is explicitly retreived. If the remote image location was been set up properly in the meantime, then it won\u0027t fail at all.\n\nSo the tolerance for HEAD failure was an attempt to retain that semantic.","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"}],"glance/store/s3.py":[{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"417113782c6346194db3d488629567e53798420b","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        try:"},{"line_number":265,"context_line":"            key \u003d self._retrieve_key(location)"},{"line_number":266,"context_line":"            return key.size"},{"line_number":267,"context_line":"        except:"},{"line_number":268,"context_line":"            return 0"},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _retrieve_key(self, location):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F808%3D","line":267,"updated":"2012-01-18 22:48:07.000000000","message":"You might want to be more specific on the exception type. If not then to conform to the HACKING guide, you\u0027ll need:\n\n    except Exception:","commit_id":"100d7787a95ca6ec1455203a51ae298331d9dae4"}],"glance/store/swift.py":[{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"417113782c6346194db3d488629567e53798420b","unresolved":false,"context_lines":[{"line_number":292,"context_line":"            resp_headers \u003d swift_conn.head_object(container\u003dloc.container,"},{"line_number":293,"context_line":"                                                  obj\u003dloc.obj)"},{"line_number":294,"context_line":"            return resp_headers.get(\u0027content-length\u0027, 0)"},{"line_number":295,"context_line":"        except:"},{"line_number":296,"context_line":"            return 0"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"    def _make_swift_connection(self, auth_url, user, key):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAD3%2F%2F80w%3D","line":295,"updated":"2012-01-18 22:48:07.000000000","message":"except Exception:","commit_id":"100d7787a95ca6ec1455203a51ae298331d9dae4"}],"glance/tests/functional/test_s3.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6f4eab6d0f4df774ea4873ec8fb813d6f9c2b519","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        self.assertEqual(data[\u0027image\u0027][\u0027size\u0027], FIVE_KB)"},{"line_number":220,"context_line":"        # checksum is not set for a remote image, as the image data"},{"line_number":221,"context_line":"        # is not yet retrieved"},{"line_number":222,"context_line":"        self.assertEqual(data[\u0027image\u0027][\u0027checksum\u0027], None)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        # 5. GET second image and make sure it can stream the image"},{"line_number":225,"context_line":"        path \u003d \"http://%s:%d/v1/images/%s\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F86o%3D","line":222,"updated":"2012-01-18 19:42:19.000000000","message":"Hmm, looks like this test case may have been bad to begin with... We should have been checking the contents returned by the POST call. tsk, tsk...\n\nIn any case, in a future patch, if you\u0027d like, you can add a get_checksum() method to the backend driver class that may be used to get a checksum from a returned Content-MD5 header, a returned ETag header (in case of Swift) OR by manually generating a checksum of a remote image file\u0027s contents... just a thought for a rainy day bored coding session ;)","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"},{"author":{"_account_id":2284,"name":"Eoghan Glynn","email":"eglynn@redhat.com","username":"eglynn"},"change_message_id":"425cdffab4d1640466c26dfb404492e7bf8b2e46","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        self.assertEqual(data[\u0027image\u0027][\u0027size\u0027], FIVE_KB)"},{"line_number":220,"context_line":"        # checksum is not set for a remote image, as the image data"},{"line_number":221,"context_line":"        # is not yet retrieved"},{"line_number":222,"context_line":"        self.assertEqual(data[\u0027image\u0027][\u0027checksum\u0027], None)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        # 5. GET second image and make sure it can stream the image"},{"line_number":225,"context_line":"        path \u003d \"http://%s:%d/v1/images/%s\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAD3%2F%2F84A%3D","line":222,"in_reply_to":"AAAAD3%2F%2F86o%3D","updated":"2012-01-18 21:34:41.000000000","message":"That\u0027s a very interesting idea.\n\nHowever there\u0027s one spanner in the works in that the ETag header is not guaranteed to be the MD5 hash of the content. In the case of S3 and Swift it is indeed the MD5 hash, whereas Apache httpd by default generates the ETag from the file inode, mtime, size and such.\n\nSimilarly the presence Content-MD5 header can\u0027t be relied upon (requires explicit configuration for Apache IIRC).\n\nAnother idea would be to populate the checksum metadata lazily, the first time the image content is actually downloaded (i.e. either pre-fetched or explicitly requested via GET).","commit_id":"e37d85fe204c4643fb78149f1102bad79477e630"}]}
