)]}'
{"glanceclient/common/http.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"3ad3c2898be0bac045f467afb7223d50406790ec","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            # NOTE(dosaboy): only set content-length if not chunking since"},{"line_number":268,"context_line":"            # setting it will implicitly disable chunking. We check for real"},{"line_number":269,"context_line":"            # image size and override user-supplied size if provided."},{"line_number":270,"context_line":"            content_length \u003d utils.get_file_size(kwargs[\u0027body\u0027])"},{"line_number":271,"context_line":"            if content_length is None:"},{"line_number":272,"context_line":"                content_length \u003d kwargs.get(\u0027content_length\u0027, None)"},{"line_number":273,"context_line":"            if (hasattr(kwargs[\u0027body\u0027], \u0027read\u0027) and"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FS4s%3D","line":270,"updated":"2013-09-30 17:48:01.000000000","message":"It seems like if content length is specified, we should always take that value, and only use get_file_size() if content_length is *not* already given to us.\n\nDo you agree?","commit_id":"27e3bdf1f49896029d01f91e16f6ecbcff8aea78"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"8387cff5e0cae4dec07db2f62f02c10493a64914","unresolved":false,"context_lines":[{"line_number":267,"context_line":"            # NOTE(dosaboy): only set content-length if not chunking since"},{"line_number":268,"context_line":"            # setting it will implicitly disable chunking. We check for real"},{"line_number":269,"context_line":"            # image size and override user-supplied size if provided."},{"line_number":270,"context_line":"            content_length \u003d utils.get_file_size(kwargs[\u0027body\u0027])"},{"line_number":271,"context_line":"            if content_length is None:"},{"line_number":272,"context_line":"                content_length \u003d kwargs.get(\u0027content_length\u0027, None)"},{"line_number":273,"context_line":"            if (hasattr(kwargs[\u0027body\u0027], \u0027read\u0027) and"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FH1M%3D","line":270,"in_reply_to":"AAAAS3%2F%2FS4s%3D","updated":"2013-10-03 22:21:41.000000000","message":"Agreed. I\u0027ll get this tidied up.","commit_id":"27e3bdf1f49896029d01f91e16f6ecbcff8aea78"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"d13e00958afaae08ce796ee905de3e625e4ebae8","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        kwargs[\u0027headers\u0027].setdefault(\u0027Content-Type\u0027,"},{"line_number":282,"context_line":"                                     \u0027application/octet-stream\u0027)"},{"line_number":283,"context_line":"        if \u0027body\u0027 in kwargs:"},{"line_number":284,"context_line":"            if (hasattr(kwargs[\u0027body\u0027], \u0027read\u0027) and"},{"line_number":285,"context_line":"                    method.lower() in (\u0027post\u0027, \u0027put\u0027)):"},{"line_number":286,"context_line":"                # NOTE(dosaboy): only use chunked transfer if not setting a"},{"line_number":287,"context_line":"                # content length since setting it will implicitly disable"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAATn%2F8vsU%3D","line":284,"updated":"2013-12-20 19:09:27.000000000","message":"Not a blocker by any means, but if you wanted to merge this if with the one above, that would make the overall indent on the code block below less (\u003d better)","commit_id":"cfff6ac3c7df3b4af2f2e749f01bc2b3e4c751b0"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"5c6e11d461dc80bdfe23b9bba28479b38faf2035","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        kwargs[\u0027headers\u0027].setdefault(\u0027Content-Type\u0027,"},{"line_number":282,"context_line":"                                     \u0027application/octet-stream\u0027)"},{"line_number":283,"context_line":"        if \u0027body\u0027 in kwargs:"},{"line_number":284,"context_line":"            if (hasattr(kwargs[\u0027body\u0027], \u0027read\u0027) and"},{"line_number":285,"context_line":"                    method.lower() in (\u0027post\u0027, \u0027put\u0027)):"},{"line_number":286,"context_line":"                # NOTE(dosaboy): only use chunked transfer if not setting a"},{"line_number":287,"context_line":"                # content length since setting it will implicitly disable"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Bwfk%3D","line":284,"in_reply_to":"AAAATn%2F8vsU%3D","updated":"2014-01-22 13:48:43.000000000","message":"Done","commit_id":"cfff6ac3c7df3b4af2f2e749f01bc2b3e4c751b0"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"b4452a8d66a997b93c980608275ad87d8f0ee220","unresolved":false,"context_lines":[{"line_number":296,"context_line":"            file_content_length \u003d utils.get_file_size(kwargs[\u0027body\u0027])"},{"line_number":297,"context_line":"            if content_length is None:"},{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2Babw%3D","line":299,"updated":"2014-01-27 07:24:38.000000000","message":"(nit): Why not:   elif file_content_length and content_length !\u003d file_content_length?","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"937011bd5953cbc83532f7d115c78b67db3b48d9","unresolved":false,"context_lines":[{"line_number":296,"context_line":"            file_content_length \u003d utils.get_file_size(kwargs[\u0027body\u0027])"},{"line_number":297,"context_line":"            if content_length is None:"},{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F92Qo%3D","line":299,"in_reply_to":"AAAAUH%2F%2BZ6E%3D","updated":"2014-02-03 11:05:14.000000000","message":"@flwang: so, apologies for misreading your comment above. I was concerned this may affect zero-size files (something we should probably disallow since they get stuck i.e. once you upload a zero-size file you cannot change it and i\u0027m not sure there is any use for that) but it appears to be ok so ill change this.","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"201aef102f11a6e60e838751b13495d73c9b61f4","unresolved":false,"context_lines":[{"line_number":296,"context_line":"            file_content_length \u003d utils.get_file_size(kwargs[\u0027body\u0027])"},{"line_number":297,"context_line":"            if content_length is None:"},{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2BZ6E%3D","line":299,"in_reply_to":"AAAAUH%2F%2Babw%3D","updated":"2014-01-27 09:48:32.000000000","message":"@flwang: we only want to report the error if we were able to infer the size from the data object, which may not always be possible (e.g. named pipes), and a content-length was supplied which does not match the inferred size.","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"b4452a8d66a997b93c980608275ad87d8f0ee220","unresolved":false,"context_lines":[{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"},{"line_number":303,"context_line":"                          (content_length, file_content_length))"},{"line_number":304,"context_line":"                raise AttributeError(errmsg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2Baes%3D","line":301,"updated":"2014-01-27 07:24:38.000000000","message":"(nit): But would you mind changing \u0027content-length\u0027 to \u0027size\u0027 given the message will be displayed for user and he is setting the --size argument. BTW, it would be nice if you can capitalize the \u0027supplied\u0027. Thanks.\n\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\n\nflwang@flwang-ThinkPad-X230:~/MyWorkSpace/workspace_community/python-glanceclient$ glance --os-image-api-version 2 image-upload fa757a88-982f-467a-a48b-e919aa410153 --file /home/flwang/Downloads/ubuntu-12.04.2-desktop-amd64.iso --size 1\nsupplied content-length (1) does not match length of supplied data (728760320)","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"d915c009bab1a3bd2d368af71028983b7ed50b61","unresolved":false,"context_lines":[{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"},{"line_number":303,"context_line":"                          (content_length, file_content_length))"},{"line_number":304,"context_line":"                raise AttributeError(errmsg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2BZ08%3D","line":301,"in_reply_to":"AAAAUH%2F%2BZ5Q%3D","updated":"2014-01-27 10:00:06.000000000","message":"@flwang: on second thoughts i\u0027m not convinced that changing this to \u0027size\u0027 makes things clearer. Calling it content-length implies that we are specifically talking about the data content of the request where \u0027size\u0027 is kind of ambiguous.","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"201aef102f11a6e60e838751b13495d73c9b61f4","unresolved":false,"context_lines":[{"line_number":298,"context_line":"                content_length \u003d file_content_length"},{"line_number":299,"context_line":"            elif ((file_content_length is not None) and"},{"line_number":300,"context_line":"                    (content_length !\u003d file_content_length)):"},{"line_number":301,"context_line":"                errmsg \u003d (\"supplied content-length (%s) does not match \""},{"line_number":302,"context_line":"                          \"length of supplied data (%s)\" %"},{"line_number":303,"context_line":"                          (content_length, file_content_length))"},{"line_number":304,"context_line":"                raise AttributeError(errmsg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2BZ5Q%3D","line":301,"in_reply_to":"AAAAUH%2F%2Baes%3D","updated":"2014-01-27 09:48:32.000000000","message":"@flwang: fair point. I\u0027ll change this.","commit_id":"3ba76e14e8253aa602ba2a287d927b25b7b68f03"}],"glanceclient/v2/images.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"3f42a9516505c42fcdbd25c74662e40196af6e1e","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        Upload the data for an image."},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        :param image_id: ID of the image to upload data for."},{"line_number":104,"context_line":"        :param image_data: File-like object supplying the data to upload."},{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":107,"context_line":"        hdrs \u003d {\u0027Content-Type\u0027: \u0027application/octet-stream\u0027}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BwFw%3D","line":104,"updated":"2013-11-20 17:17:07.000000000","message":"Would you mind adding a parameter doc string for image_size?","commit_id":"9d31764c5bff55239f38ec884f97874a6dbd75a6"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"75269abafa95c01d22ebe3ccc012f289736c58e6","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        Upload the data for an image."},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        :param image_id: ID of the image to upload data for."},{"line_number":104,"context_line":"        :param image_data: File-like object supplying the data to upload."},{"line_number":105,"context_line":"        \"\"\""},{"line_number":106,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":107,"context_line":"        hdrs \u003d {\u0027Content-Type\u0027: \u0027application/octet-stream\u0027}"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAATn%2F%2BmHs%3D","line":104,"in_reply_to":"AAAATn%2F%2BwFw%3D","updated":"2013-11-22 17:23:20.000000000","message":"Done","commit_id":"9d31764c5bff55239f38ec884f97874a6dbd75a6"}],"tests/v2/test_images.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"3ad3c2898be0bac045f467afb7223d50406790ec","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                  image_data)]"},{"line_number":475,"context_line":"        self.assertEqual(self.api.calls, expect)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def test_data_upload_w_size(self):"},{"line_number":478,"context_line":"        image_data \u003d \u0027CCC\u0027"},{"line_number":479,"context_line":"        image_id \u003d \u0027606b0e88-7c5a-4d54-b5bb-046105d4de6f\u0027"},{"line_number":480,"context_line":"        self.controller.upload(image_id, image_data, image_size\u003d3)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FS30%3D","line":477,"updated":"2013-09-30 17:48:01.000000000","message":"Can we also check on size when it comes from the utils.get_file_size?","commit_id":"27e3bdf1f49896029d01f91e16f6ecbcff8aea78"},{"author":{"_account_id":6737,"name":"Edward Hope-Morley","email":"edward.hope-morley@canonical.com","username":"hopem"},"change_message_id":"8387cff5e0cae4dec07db2f62f02c10493a64914","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                  image_data)]"},{"line_number":475,"context_line":"        self.assertEqual(self.api.calls, expect)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    def test_data_upload_w_size(self):"},{"line_number":478,"context_line":"        image_data \u003d \u0027CCC\u0027"},{"line_number":479,"context_line":"        image_id \u003d \u0027606b0e88-7c5a-4d54-b5bb-046105d4de6f\u0027"},{"line_number":480,"context_line":"        self.controller.upload(image_id, image_data, image_size\u003d3)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FH1A%3D","line":477,"in_reply_to":"AAAAS3%2F%2FS30%3D","updated":"2013-10-03 22:21:41.000000000","message":"Yup I\u0027ll add that in.","commit_id":"27e3bdf1f49896029d01f91e16f6ecbcff8aea78"}]}
