)]}'
{"glanceclient/v2/images.py":[{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"d527ba7d7e6a021cb564684fce1ad52f21a79adc","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":193,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":194,"context_line":"        if resp.status_code \u003d\u003d 204:"},{"line_number":195,"context_line":"            raise exc.HTTPNotFound(\u0027No image data could be found \u0027"},{"line_number":196,"context_line":"                                   \u0027for image %s \u0027 % image_id)"},{"line_number":197,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":198,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_51615ca7","line":195,"updated":"2015-07-17 16:49:46.000000000","message":"I\u0027m not convinced this is the best possible exception. This should be used for 404 not found, not 204 no content messages. The exception class specifically sets the code to 404. That\u0027s misleading and just plain wrong.\n\nWhile I agree there\u0027s a bug here, I don\u0027t agree that this is exception worthy.\n\nWe should log something here (I don\u0027t think this is warning worthy, maybe debug or info) and we should successfully return an empty iterable.","commit_id":"6952028822a46fdabc8fb004ebd18c7bd5fc32d0"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"9826da8321c55b057c4c2c4249faacfe60675d6f","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":193,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":194,"context_line":"        if resp.status_code \u003d\u003d 204:"},{"line_number":195,"context_line":"            raise exc.HTTPNotFound(\u0027No image data could be found \u0027"},{"line_number":196,"context_line":"                                   \u0027for image %s \u0027 % image_id)"},{"line_number":197,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":198,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_9213535c","line":195,"in_reply_to":"9a41bdd9_51615ca7","updated":"2015-07-18 04:17:08.000000000","message":"In my opinion, 204 is returned from glance server side indicating no data, it is reasonable. When it comes to glanceclient, it is used by end user, I am thinking how to make a good user experience, suppose we make an empty iterable body,then nothing would be returned after running the glanceclient cli, user may be confused and not know what happens. From user\u0027s point of view, he wants to download data, if no data is returned, user often thinks the cli should fail and tell the reason. Another consideration is the cli return code, I know some app checks cli return code to decide whether it is successful or not, throwing an exception here can make glanceclient shell return 1 which means cli failing.","commit_id":"6952028822a46fdabc8fb004ebd18c7bd5fc32d0"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"85b575f6295d8d153f99bf188ffd632a72509a9b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":193,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":194,"context_line":"        if resp.status_code \u003d\u003d 204:"},{"line_number":195,"context_line":"            raise exc.HTTPNotFound(\u0027No image data could be found \u0027"},{"line_number":196,"context_line":"                                   \u0027for image %s \u0027 % image_id)"},{"line_number":197,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":198,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_b711a15f","line":195,"in_reply_to":"9a41bdd9_9213535c","updated":"2015-07-18 14:59:52.000000000","message":"Except this isn\u0027t just being used by the CLI. People are writing other tools that integrate with glanceclient as a library. If I have code to retrieve the data in some tooling that I wrote and I have to catch a NotFound exception because there was no data, I\u0027m going to be pretty angry because the Image exists and if I turn on logging I\u0027ll see a 204 but the client library is lying to me.\n\nIf you want the CLI to return a different status code than 0 when there\u0027s no data (or to print something else) that belongs in the shell modules, not here.\n\nThat said, there is a bug here but this is *not* the right fix for it.","commit_id":"6952028822a46fdabc8fb004ebd18c7bd5fc32d0"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"81df265938d3c51fde27fd92ce75a4550422f225","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":193,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":194,"context_line":"        if resp.status_code \u003d\u003d 204:"},{"line_number":195,"context_line":"            raise exc.HTTPNotFound(\u0027No image data could be found \u0027"},{"line_number":196,"context_line":"                                   \u0027for image %s \u0027 % image_id)"},{"line_number":197,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":198,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a8ffd7b_3f75e130","line":195,"in_reply_to":"9a41bdd9_b711a15f","updated":"2015-11-30 10:26:51.000000000","message":"\u003e the client library is lying to me.\n\nIn the case of 204 (no body), returning an iterable body is also a misrepresentation.\n\nAccording to the standards (http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html) \"The 204 response MUST NOT include a message-body\".\n\nI don\u0027t believe returning an iterable in this case is appropriate -- it implies a zero size body rather than the absence of a body.\n\nThat is a misrepresentation.\n\nIt means that consumers of the client library cannot tell the difference between a truly zero size \"/file\" (active image) and a \"/file\" which does not yet have any bytes in it (queued image).\n\nWhen directly accessing the API the \"/file\" resource is unambiguous. You do not get a \"body\" unless one actually exists.\n\nI believe it is very important for consumers of the library to also be able to distinguish between those two cases.","commit_id":"6952028822a46fdabc8fb004ebd18c7bd5fc32d0"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"8e5a983037bc8d864cee0e106d1e8845d720480b","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":193,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":194,"context_line":"        if resp.status_code \u003d\u003d 204:"},{"line_number":195,"context_line":"            raise exc.HTTPNotFound(\u0027No image data could be found \u0027"},{"line_number":196,"context_line":"                                   \u0027for image %s \u0027 % image_id)"},{"line_number":197,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":198,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_1d60fd34","line":195,"in_reply_to":"9a41bdd9_b711a15f","updated":"2015-07-20 07:43:10.000000000","message":"That makes sense to me. I will make a new patch to do it. Thanks for your good comments.","commit_id":"6952028822a46fdabc8fb004ebd18c7bd5fc32d0"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"0c58ad22284669f0cd250a8e639b0c8e0002152f","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data could be found\")"},{"line_number":198,"context_line":"            return iter(())"},{"line_number":199,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":200,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":11,"id":"3a29b11f_d2482f30","line":197,"updated":"2015-10-19 09:34:26.000000000","message":"What about \"No image data available\" ?","commit_id":"7d2dd29826f3cb925f5af4cb2be73ff1417e6cf7"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"43e42189fbda20b04e066f800de6af4e638374d6","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data could be found\")"},{"line_number":198,"context_line":"            return iter(())"},{"line_number":199,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":200,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":11,"id":"ba8a016a_b4644f49","line":197,"in_reply_to":"3a29b11f_d2482f30","updated":"2015-11-23 03:47:31.000000000","message":"Done","commit_id":"7d2dd29826f3cb925f5af4cb2be73ff1417e6cf7"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"2bc1e83a08da26fe4cb0161e3e2aebc455a92ede","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        :param do_checksum: Enable/disable checksum validation."},{"line_number":193,"context_line":"        \"\"\""},{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data available\")"},{"line_number":198,"context_line":"            return iter(())"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_f1253bae","line":195,"updated":"2015-11-24 13:57:27.000000000","message":"ie if resp.status is not 200 then raise an exception. If its 204 raise a specific exception.","commit_id":"c2d5055671a153c816a61ee99933034a07979f54"},{"author":{"_account_id":15501,"name":"Long Quan Sha","email":"shalq@cn.ibm.com","username":"shalq"},"change_message_id":"b849996d718babcb6712f3c5999d55bd7e3dac05","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        :param do_checksum: Enable/disable checksum validation."},{"line_number":193,"context_line":"        \"\"\""},{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data available\")"},{"line_number":198,"context_line":"            return iter(())"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_591ed770","line":195,"in_reply_to":"9a8ffd7b_f1253bae","updated":"2015-11-29 09:37:08.000000000","message":"Thanks for your comments, I tried raising an exception here, but Ian Cordasco discussed with me about this in patch 9, the conclusion is that there shouldn\u0027t raising an exception here. The reason is as below, you can get more in patch 9.  \n\n Except this isn\u0027t just being used by the CLI. People are writing other tools that integrate with glanceclient as a library. If I have code to retrieve the data in some tooling that I wrote and I have to catch a NotFound exception because there was no data, I\u0027m going to be pretty angry because the Image exists and if I turn on logging I\u0027ll see a 204 but the client library is lying to me.\n\nIf you want the CLI to return a different status code than 0 when there\u0027s no data (or to print something else) that belongs in the shell modules, not here.","commit_id":"c2d5055671a153c816a61ee99933034a07979f54"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"2792a7ef5f383757cd0cea6055716f1e99d80f46","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data available\")"},{"line_number":198,"context_line":"            return iter(())"},{"line_number":199,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":200,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_51177944","line":197,"updated":"2015-11-30 11:01:10.000000000","message":"Note: This would return a \u0027valid\u0027 body even if we get \u0027500\u0027 from the server.","commit_id":"c2d5055671a153c816a61ee99933034a07979f54"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"5b704cd2edaf22eb74f1945d27ea5ca24b6edb04","unresolved":false,"context_lines":[{"line_number":194,"context_line":"        url \u003d \u0027/v2/images/%s/file\u0027 % image_id"},{"line_number":195,"context_line":"        resp, body \u003d self.http_client.get(url)"},{"line_number":196,"context_line":"        if body is None:"},{"line_number":197,"context_line":"            LOG.debug(\"No image data available\")"},{"line_number":198,"context_line":"            return iter(())"},{"line_number":199,"context_line":"        checksum \u003d resp.headers.get(\u0027content-md5\u0027, None)"},{"line_number":200,"context_line":"        content_length \u003d int(resp.headers.get(\u0027content-length\u0027, 0))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a8ffd7b_31bd1502","line":197,"in_reply_to":"9a8ffd7b_51177944","updated":"2015-11-30 11:04:32.000000000","message":"ie in the case of a 500, if the image is active, the checksum will be bypassed, and no error will be raised even though we have returned bad data.","commit_id":"c2d5055671a153c816a61ee99933034a07979f54"}]}
