)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"e6c07c7d599870823f7d25bebbcf6bcdbceacf87","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Prevent creation of http images with invalid URIs"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Active images should always be ready to downloaded, regardless they\u0027re"},{"line_number":10,"context_line":"locally or remotely stored.  This patch prevents images with invalid"},{"line_number":11,"context_line":"location URIs from being created and entering the \u0027active\u0027 state with no"},{"line_number":12,"context_line":"data.  This is only for the HTTP store."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAUH%2F%2FaOo%3D","line":9,"updated":"2014-01-14 01:53:51.000000000","message":"typo: to be downloaded","commit_id":"f1981bfaed43177689f0ff4ffe4ba50588285400"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"e6c07c7d599870823f7d25bebbcf6bcdbceacf87","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Active images should always be ready to downloaded, regardless they\u0027re"},{"line_number":10,"context_line":"locally or remotely stored.  This patch prevents images with invalid"},{"line_number":11,"context_line":"location URIs from being created and entering the \u0027active\u0027 state with no"},{"line_number":12,"context_line":"data.  This is only for the HTTP store."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Iec7a0457ffb3f937a058ad7c85b01179960a6d49"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"AAAAUH%2F%2FaPQ%3D","line":11,"updated":"2014-01-14 01:53:51.000000000","message":"\u003c 72","commit_id":"f1981bfaed43177689f0ff4ffe4ba50588285400"}],"glance/api/v1/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a9d237e4b9afd0543bcabbd3485a32d8f4248c63","unresolved":false,"context_lines":[{"line_number":507,"context_line":"                image_meta[\u0027size\u0027] \u003d self._get_size(req.context, image_meta,"},{"line_number":508,"context_line":"                                                    location)"},{"line_number":509,"context_line":"            except exception.BadStoreUri:"},{"line_number":510,"context_line":"                msg \u003d _(\"Invalid location %s\") % location"},{"line_number":511,"context_line":"                LOG.debug(msg)"},{"line_number":512,"context_line":"                raise HTTPBadRequest(explanation\u003dmsg)"},{"line_number":513,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FrUQ%3D","line":510,"updated":"2014-01-09 18:14:22.000000000","message":"what about return exception object/message to end user, it may have worth \"reason\" message for end user? like:\n\nexcept exception.BadStoreUri as err:\n    msg \u003d _(\"Invalid location %s\") % unicode(err)\n    ...","commit_id":"3c610ed4974a0f95d830828df6ab6ee501c0aa49"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"34dc59abdc1ff39354639c62f639b962ff6a1cc6","unresolved":false,"context_lines":[{"line_number":507,"context_line":"                image_meta[\u0027size\u0027] \u003d self._get_size(req.context, image_meta,"},{"line_number":508,"context_line":"                                                    location)"},{"line_number":509,"context_line":"            except exception.NotFound as e:"},{"line_number":510,"context_line":"                LOG.debug(unicode(e))"},{"line_number":511,"context_line":"                raise HTTPBadRequest(explanation\u003dunicode(e),"},{"line_number":512,"context_line":"                                     request\u003dreq,"},{"line_number":513,"context_line":"                                     content_type\u003d\"text/plain\")"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FILo%3D","line":510,"updated":"2014-01-17 06:21:14.000000000","message":"nit for performance, what about this:\n\n    msg \u003d unicode(e)\n    LOG.debug(msg)\n    raise HTTPBadRequest(explanation\u003dmsg,","commit_id":"1a0972b944b862f872901da35dd634779a5ed16f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e3fb9bd060aa9124f03e74950be4c4ae81997adb","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            try:"},{"line_number":514,"context_line":"                image_meta[\u0027size\u0027] \u003d self._get_size(req.context, image_meta,"},{"line_number":515,"context_line":"                                                    location)"},{"line_number":516,"context_line":"            except exception.NotFound as e:"},{"line_number":517,"context_line":"                msg \u003d unicode(e)"},{"line_number":518,"context_line":"                LOG.debug(msg)"},{"line_number":519,"context_line":"                raise HTTPBadRequest(explanation\u003dmsg,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2Fqmw%3D","line":516,"updated":"2014-02-11 16:47:48.000000000","message":"What about move this stuff to _get_size()? it\u0027s more common and reusable IMO.","commit_id":"d9dcd5e16b2e77640cd5912b2907e014ac6c1a25"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e3fb9bd060aa9124f03e74950be4c4ae81997adb","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                                     request\u003dreq,"},{"line_number":521,"context_line":"                                     content_type\u003d\"text/plain\")"},{"line_number":522,"context_line":"            except exception.BadStoreUri:"},{"line_number":523,"context_line":"                msg \u003d _(\"Invalid location %s\") % location"},{"line_number":524,"context_line":"                LOG.debug(msg)"},{"line_number":525,"context_line":"                raise HTTPBadRequest(explanation\u003dmsg,"},{"line_number":526,"context_line":"                                     request\u003dreq,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2FqoA%3D","line":523,"updated":"2014-02-11 16:47:48.000000000","message":"Don\u0027t log location pls, it is a potential security issue since URL may including  sensitive info that to be used to access storage.","commit_id":"d9dcd5e16b2e77640cd5912b2907e014ac6c1a25"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"ece868222ecd17e3f28835759b5040571a107f89","unresolved":false,"context_lines":[{"line_number":676,"context_line":"            size \u003d (image_meta.get(\u0027size\u0027, 0) or"},{"line_number":677,"context_line":"                    get_size_from_backend(context, location))"},{"line_number":678,"context_line":"        except (exception.NotFound, exception.BadStoreUri) as e:"},{"line_number":679,"context_line":"            msg \u003d unicode(e)"},{"line_number":680,"context_line":"            LOG.debug(msg)"},{"line_number":681,"context_line":"            raise HTTPBadRequest(explanation\u003dmsg, content_type\u003d\"text/plain\")"},{"line_number":682,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FnP0%3D","line":679,"updated":"2014-03-05 02:55:27.000000000","message":"six.text_type(e) will make py3 happy","commit_id":"1294d2566cf21c738894ca5dc6f5c222d26ac938"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"ece868222ecd17e3f28835759b5040571a107f89","unresolved":false,"context_lines":[{"line_number":678,"context_line":"        except (exception.NotFound, exception.BadStoreUri) as e:"},{"line_number":679,"context_line":"            msg \u003d unicode(e)"},{"line_number":680,"context_line":"            LOG.debug(msg)"},{"line_number":681,"context_line":"            raise HTTPBadRequest(explanation\u003dmsg, content_type\u003d\"text/plain\")"},{"line_number":682,"context_line":""},{"line_number":683,"context_line":"    def _handle_source(self, req, image_id, image_meta, image_data):"},{"line_number":684,"context_line":"        copy_from \u003d self._copy_from(req)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FnQU%3D","line":681,"updated":"2014-03-05 02:55:27.000000000","message":"...explanation\u003de.msg...","commit_id":"1294d2566cf21c738894ca5dc6f5c222d26ac938"}],"glance/store/http.py":[{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"41d08f1afba4b79f28d3e141126fd1a7b5c42fab","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        except exception.BadStoreUri:"},{"line_number":153,"context_line":"            msg \u003d _(\"Invalid location %s\") % location.get_store_uri()"},{"line_number":154,"context_line":"            LOG.debug(msg)"},{"line_number":155,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":156,"context_line":"        except Exception as e:"},{"line_number":157,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":158,"context_line":"                   location.get_store_uri())"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F8%2FAU%3D","line":155,"updated":"2013-12-18 03:24:05.000000000","message":"Sorry for the -1, but I\u0027m not really comfortable to place webob.exc in the store driver level. IMHO, the exception.BadStoreUri should be handled by API/domain layer.","commit_id":"5a8a479d34634be3aea4a1508adebdeddbf5bb52"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"473e0d7fda2456e62102747399e273229980f068","unresolved":false,"context_lines":[{"line_number":152,"context_line":"        except exception.BadStoreUri:"},{"line_number":153,"context_line":"            msg \u003d _(\"Invalid location %s\") % location.get_store_uri()"},{"line_number":154,"context_line":"            LOG.debug(msg)"},{"line_number":155,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":156,"context_line":"        except Exception as e:"},{"line_number":157,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":158,"context_line":"                   location.get_store_uri())"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F88zo%3D","line":155,"in_reply_to":"AAAATn%2F8%2FAU%3D","updated":"2013-12-18 13:27:11.000000000","message":"I agree with flwang here. Maybe you could catch it and re-raise it:\n\n    except exception.BadStoreUri:\n        raise\n\nAnd then raise HTTPBadRequest from the API/domain code","commit_id":"5a8a479d34634be3aea4a1508adebdeddbf5bb52"},{"author":{"_account_id":7884,"name":"Noboru Arai","email":"arai@mxa.nes.nec.co.jp","username":"NoboruArai"},"change_message_id":"c88eeebb42de23831b2d6a21d43a04aadf48fe41","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            msg \u003d _(\"Invalid location %s\") % location.get_store_uri()"},{"line_number":154,"context_line":"            LOG.debug(msg)"},{"line_number":155,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":156,"context_line":"        except Exception as e:"},{"line_number":157,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":158,"context_line":"                   location.get_store_uri())"},{"line_number":159,"context_line":"            LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F9K8Y%3D","line":156,"updated":"2013-12-16 00:46:09.000000000","message":"\"e\" variable is unused after this line.","commit_id":"5a8a479d34634be3aea4a1508adebdeddbf5bb52"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"473e0d7fda2456e62102747399e273229980f068","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            msg \u003d _(\"Invalid location %s\") % location.get_store_uri()"},{"line_number":154,"context_line":"            LOG.debug(msg)"},{"line_number":155,"context_line":"            raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":156,"context_line":"        except Exception as e:"},{"line_number":157,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":158,"context_line":"                   location.get_store_uri())"},{"line_number":159,"context_line":"            LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F88zU%3D","line":156,"in_reply_to":"AAAATn%2F9K8Y%3D","updated":"2013-12-18 13:27:11.000000000","message":"What about logging the exception? \n\n    LOG.exception(e)","commit_id":"5a8a479d34634be3aea4a1508adebdeddbf5bb52"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"39a6a5afa69421be1e8d8986021870d0ce7bcf66","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":155,"context_line":"                   location.get_store_uri())"},{"line_number":156,"context_line":"            LOG.debug(msg)"},{"line_number":157,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8ovA%3D","line":154,"updated":"2013-12-23 22:30:59.000000000","message":"Could you add a test for this exception?","commit_id":"08eefc4955f2a02afc799b45c31cd8ff6436569a"},{"author":{"_account_id":9520,"name":"David Koo (koofoss)","email":"david.koo@huawei.com","username":"koofoss"},"change_message_id":"e5afe6488899041de62293d0a275653102bfe385","unresolved":false,"context_lines":[{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query location: %s, reporting size of 0\") %"},{"line_number":155,"context_line":"                   location.get_store_uri())"},{"line_number":156,"context_line":"            LOG.debug(msg)"},{"line_number":157,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8lfo%3D","line":154,"updated":"2013-12-25 01:03:08.000000000","message":"I think we should be very careful about writing URLs into logs because they can contain sensitive information (username/password). If we must log URL info then we should first remove sensitive info.","commit_id":"08eefc4955f2a02afc799b45c31cd8ff6436569a"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a9d237e4b9afd0543bcabbd3485a32d8f4248c63","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"},{"line_number":156,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FrU8%3D","line":153,"updated":"2014-01-09 18:14:22.000000000","message":"IMO we\u0027d better follow this https://github.com/openstack/glance/blob/master/glance/store/base.py#L115 , to allow raise NotFound exception. And I consider do catching on  Exception level is not a good idea, it can swallow potential defect.\n\nActually we have some discussions around this part, you can see them at https://review.openstack.org/#/c/64409/4/glance/store/http.py , if you think those are long you can just see our agreement at #3 comments from bottom.","commit_id":"3c610ed4974a0f95d830828df6ab6ee501c0aa49"},{"author":{"_account_id":9236,"name":"Jon Bernard","email":"jobernar@redhat.com","username":"jbernard"},"change_message_id":"348645d6b6a96282a34a9329d48269df24fed216","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"},{"line_number":156,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2Fk6Q%3D","line":153,"in_reply_to":"AAAAUH%2F%2FrU8%3D","updated":"2014-01-10 20:55:58.000000000","message":"I don\u0027t completely follow what you\u0027re suggesting here, can you elaborate a bit?","commit_id":"3c610ed4974a0f95d830828df6ab6ee501c0aa49"},{"author":{"_account_id":9236,"name":"Jon Bernard","email":"jobernar@redhat.com","username":"jbernard"},"change_message_id":"17e9c38ab02cb799961b6310c5b2c2abefa165ac","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise exception.NotFound(unicode(e))"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fk4M%3D","line":152,"updated":"2014-01-10 21:03:57.000000000","message":"Zhi Yan Liu: is this what you meant?","commit_id":"8e825710984cdf1314ffc9df0594fb7ea40f49a8"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"8a0463b578e2dac3b948feaf872084e4dae6268b","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise exception.NotFound(unicode(e))"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fgiw%3D","line":152,"in_reply_to":"AAAAUH%2F%2Fj34%3D","updated":"2014-01-13 07:09:07.000000000","message":"+1 same concern as zhiyan, because we don\u0027t provide a good NotFound set, see https://bugs.launchpad.net/glance/+bug/1265448 So I prefer to raise the BadStoreUri instead of NotFound.","commit_id":"8e825710984cdf1314ffc9df0594fb7ea40f49a8"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a7d16fc0857863ac45b4cea25f91a25e19222431","unresolved":false,"context_lines":[{"line_number":149,"context_line":"            return self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise exception.NotFound(unicode(e))"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fj34%3D","line":152,"in_reply_to":"AAAAUH%2F%2Fk4M%3D","updated":"2014-01-11 06:06:07.000000000","message":"Sorry for my former confusing comments.\n\nYes Jon this shape is my part purpose, I think we need follow https://github.com/openstack/glance/blob/master/glance/store/base.py#L115 , to raise NotFound when store get_size function failed.\n\nBut I consider there are still two issues to me:\n\n1. We\u0027d better don\u0027t transform BadStoreUri to NotFound, IMO store driver should be able to expose those two exceptions. So can we change _query() to allow it raise NotFound exception out directly when it meet 404 issue?","commit_id":"8e825710984cdf1314ffc9df0594fb7ea40f49a8"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"a7d16fc0857863ac45b4cea25f91a25e19222431","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        except exception.BadStoreUri as e:"},{"line_number":151,"context_line":"            LOG.exception(e)"},{"line_number":152,"context_line":"            raise exception.NotFound(unicode(e))"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            msg \u003d (_(\"Unable to query URL location, reporting size of 0\"))"},{"line_number":155,"context_line":"            LOG.debug(msg)"},{"line_number":156,"context_line":"            return 0"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2Fjzo%3D","line":153,"updated":"2014-01-11 06:06:07.000000000","message":"2. As the result we discussed which I mentioned in my latest comment within https://review.openstack.org/#/c/64409/4/glance/store/http.py , I consider we should always not catch Exception level exception in code, so IMO we can remove this catching block or keep it for write log but raise original exception out instead of return zero.\n\nthanks.","commit_id":"8e825710984cdf1314ffc9df0594fb7ea40f49a8"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"cb9035d59d3468bbee78a30536f0f9be407fa311","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        conn.request(verb, loc.path, \"\", {})"},{"line_number":160,"context_line":"        resp \u003d conn.getresponse()"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        # Check for bad status codes"},{"line_number":163,"context_line":"        if resp.status \u003e\u003d 400:"},{"line_number":164,"context_line":"            reason \u003d _(\"HTTP URL returned a %s status code.\") % resp.status"},{"line_number":165,"context_line":"            LOG.debug(reason)"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F%2FZ58%3D","line":162,"updated":"2014-01-14 03:41:36.000000000","message":"According to your above change, I think we raise NotFound exception at here is a good choice:\n\n        if resp.status \u003d\u003d httplib.NOT_FOUND:\n            reason \u003d _(\u0027HTTP datastore could not find image at URI.\u0027)\n            LOG.debug(reason)\n            raise exception.NotFound(reason)","commit_id":"f1981bfaed43177689f0ff4ffe4ba50588285400"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"34dc59abdc1ff39354639c62f639b962ff6a1cc6","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        resp \u003d conn.getresponse()"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        # Check for bad status codes"},{"line_number":163,"context_line":"        if resp.status \u003d\u003d httplib.NOT_FOUND:"},{"line_number":164,"context_line":"            reason \u003d _(\"HTTP datastore could not find image at URI.\")"},{"line_number":165,"context_line":"            LOG.debug(reason)"},{"line_number":166,"context_line":"            raise exception.NotFound(reason)"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2FIKQ%3D","line":163,"updated":"2014-01-17 06:21:14.000000000","message":"Thanks. I mean:\n\n    # Check for bad status codes\n    if resp.status \u003e\u003d 400:\n        if resp.status \u003d\u003d httplib.NOT_FOUND:\n            reason \u003d _(\"HTTP datastore could not find image at URI.\")\n            LOG.debug(reason)\n            raise exception.NotFound(reason)\n        reason \u003d _(\"HTTP URL returned a %s status code.\") % resp.status\n        LOG.debug(reason)\n        raise exception.BadStoreUri(loc.path, reason)\n\nWe still need raise exception.BadStoreUri out when needed.","commit_id":"1a0972b944b862f872901da35dd634779a5ed16f"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"e3fb9bd060aa9124f03e74950be4c4ae81997adb","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        \"\"\""},{"line_number":147,"context_line":"        try:"},{"line_number":148,"context_line":"            size \u003d self._query(location, \u0027HEAD\u0027)[2]"},{"line_number":149,"context_line":"        except socket.error:"},{"line_number":150,"context_line":"            reason \u003d _(\"HTTP datastore could not find image at URI.\")"},{"line_number":151,"context_line":"            LOG.debug(reason)"},{"line_number":152,"context_line":"            raise exception.NotFound(reason)"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAUX%2F%2Fqk8%3D","line":149,"updated":"2014-02-11 16:47:48.000000000","message":"Seems BadStoreUri is more reasonable for this exception but NotFound, but I\u0027d like to know your thoughts, thanks.","commit_id":"d9dcd5e16b2e77640cd5912b2907e014ac6c1a25"}],"glance/tests/integration/legacy_functional/test_v1_api.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"ece72d1fe5c426eda4bae6c5cbf13e1734735e18","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        response, content \u003d self.http.request(path, \u0027DELETE\u0027)"},{"line_number":329,"context_line":"        self.assertEqual(response.status, 200)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def test_size_greater_2G_mysql(self):"},{"line_number":332,"context_line":"        \"\"\""},{"line_number":333,"context_line":"        A test against the actual datastore backend for the registry"},{"line_number":334,"context_line":"        to ensure that the image size property is not truncated."}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FnJs%3D","side":"PARENT","line":331,"updated":"2014-03-05 02:58:14.000000000","message":"Do you think if there is an alternative way to cover this test case instead of removing it? IMHO the test case is worth to us.","commit_id":"f70b72b78b16d569f469f2cd6381dee6c90ed229"},{"author":{"_account_id":9236,"name":"Jon Bernard","email":"jobernar@redhat.com","username":"jbernard"},"change_message_id":"8b0b82e26f6681b99b9b289492fc040b9ab6ce0b","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        response, content \u003d self.http.request(path, \u0027DELETE\u0027)"},{"line_number":329,"context_line":"        self.assertEqual(response.status, 200)"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"    def test_size_greater_2G_mysql(self):"},{"line_number":332,"context_line":"        \"\"\""},{"line_number":333,"context_line":"        A test against the actual datastore backend for the registry"},{"line_number":334,"context_line":"        to ensure that the image size property is not truncated."}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAVn%2F%2FiYk%3D","side":"PARENT","line":331,"in_reply_to":"AAAAVn%2F%2FnJs%3D","updated":"2014-03-05 14:47:11.000000000","message":"I don\u0027t want to remove the test either, but I\u0027m not sure how to handle this case.  The test as it is written is incorrect if we assume that invalid URLs should be denied.  Since stubbing out the http store to get around this would defeat the purpose of the functional test, the only other path I can see is to reference a valid URL.  But then the test either relies on a huge in-tree image file or it requires internet access... Both are terrible.\n\nPerhaps we could run a httpd service that fakes the image data... this seems overly complex.  What are your thoughts?","commit_id":"f70b72b78b16d569f469f2cd6381dee6c90ed229"}]}
