)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"a61c3458caa232b08ce6f0db971a44aada97c0e0","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add server\u0027s supported API versions to exception HTTPNotAcceptable(406)"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Add extra headers to exception HTTPNotAcceptable. Client is able to"},{"line_number":10,"context_line":"recognize server\u0027s supported version with this."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Partial-Bug: #1417430"},{"line_number":13,"context_line":"Change-Id: I84e35af2c3e97ba70bb91b6ce32f13ca307201c5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba7be1f8_b77e5968","line":10,"updated":"2015-03-03 20:41:45.000000000","message":"How about something like \u0027Add server-supported min and max API version headers to the response associated with HTTPNotAcceptable exceptions. These exceptions could happen when the request specifies an unsupported API version. The returned headers will provide feedback to the caller as to what the acceptable versions are.","commit_id":"5979bc95752299ea62178aa01d2d3960dc86a924"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"a61c3458caa232b08ce6f0db971a44aada97c0e0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"Add extra headers to exception HTTPNotAcceptable. Client is able to"},{"line_number":10,"context_line":"recognize server\u0027s supported version with this."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Partial-Bug: #1417430"},{"line_number":13,"context_line":"Change-Id: I84e35af2c3e97ba70bb91b6ce32f13ca307201c5"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"ba7be1f8_1c03cc10","line":12,"updated":"2015-03-03 20:41:45.000000000","message":"I don\u0027t think that this needs to be part of that bug. The min/max headers should be added regardless of python-ironicclient. You could create a separate bug for this, or leave it as you have it. I would suggest not even putting a bug number but maybe others expect it.","commit_id":"5979bc95752299ea62178aa01d2d3960dc86a924"}],"ironic/api/controllers/v1/__init__.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"a61c3458caa232b08ce6f0db971a44aada97c0e0","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                \"Unsupported minor version requested. This API service \""},{"line_number":178,"context_line":"                \"supports the following version range: \""},{"line_number":179,"context_line":"                \"[%(min)s, %(max)s].\") % {\u0027min\u0027: MIN_VER_STR,"},{"line_number":180,"context_line":"                                          \u0027max\u0027: MAX_VER_STR},"},{"line_number":181,"context_line":"                headers\u003dheaders)"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    @pecan.expose()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_d7c4ad93","line":180,"updated":"2015-03-03 20:41:45.000000000","message":"Since the headers are now being returned, I think we could change this to something like \"Version %(vers)s was requested but the minor version is not supported by this service.\"","commit_id":"5979bc95752299ea62178aa01d2d3960dc86a924"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"2675ecef35ee742f376cd6a6f7758c28665d3995","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        #       the request object to make the links."},{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003d{}):"},{"line_number":168,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":169,"context_line":"        if version.major !\u003d BASE_VERSION:"},{"line_number":170,"context_line":"            raise exc.HTTPNotAcceptable(_("}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_98d84a55","line":167,"updated":"2015-03-04 16:44:58.000000000","message":"I agree with Ruby - this isn\u0027t a nit or a style issue, as it can introduce bugs that are very hard to unwind.","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d6c71845011c26f8efb8f8ae1de1f09171d8abe4","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        #       the request object to make the links."},{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003d{}):"},{"line_number":168,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":169,"context_line":"        if version.major !\u003d BASE_VERSION:"},{"line_number":170,"context_line":"            raise exc.HTTPNotAcceptable(_("}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_79656544","line":167,"updated":"2015-03-04 13:47:54.000000000","message":"nit: it\u0027s usually considered a bad practice to use mutable objects as default values for functions in Python. Not a deal here though.","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"67dcbd6c42af2cf7c9600f0ca838f19efb4fdbc7","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        #       the request object to make the links."},{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003d{}):"},{"line_number":168,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":169,"context_line":"        if version.major !\u003d BASE_VERSION:"},{"line_number":170,"context_line":"            raise exc.HTTPNotAcceptable(_("}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_cd768bd8","line":167,"in_reply_to":"9a80dd14_79656544","updated":"2015-03-04 15:19:39.000000000","message":"Good catch. Actually, I think it is more than a nit [1].\n\n[1] http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#default-parameter-values","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"e7f441fbd2d87e157a6c67d00069e896c2624bfd","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        #       the request object to make the links."},{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003d{}):"},{"line_number":168,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":169,"context_line":"        if version.major !\u003d BASE_VERSION:"},{"line_number":170,"context_line":"            raise exc.HTTPNotAcceptable(_("}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_b5b410d2","line":167,"in_reply_to":"9a80dd14_98d84a55","updated":"2015-03-05 10:45:08.000000000","message":"Thanks Ruby, I am such a beginner, and great to know this.","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"67dcbd6c42af2cf7c9600f0ca838f19efb4fdbc7","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            raise exc.HTTPNotAcceptable(_("},{"line_number":177,"context_line":"                \"Version %(ver)s was requested but the minor version is not \""},{"line_number":178,"context_line":"                \"supported by this service. Supported range is been returned \""},{"line_number":179,"context_line":"                \"within headers\") % {\u0027ver\u0027: version}, headers\u003dheaders)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    @pecan.expose()"},{"line_number":182,"context_line":"    def _route(self, args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_2db6473e","line":179,"updated":"2015-03-04 15:19:39.000000000","message":"Hmm. Do you think it is necessary to mention the \u0027Supported range ..\u0027 part? If so, the message above (L171) should do a similar thing.\n\nHow about \u0027The response header includes the supported version range.\u0027 or \u0027Supported version ranges are in the response header.\u0027\n\nIt seems like if you do the API request, you\u0027ll see the response including the header. if you do something via eg python-ironicclient, you may only see the message, not the header. So mentioning that it is in the header won\u0027t be useful unless you use eg \u0027--debug\u0027 to see the actual response.\n\nSorry, maybe we should go back to what was there originally. So the first sentence here, and the second from the original. Eg \u0027Version... was requested but the minor version is not supported by this service. The supported version range is: ....","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":2889,"name":"Aeva Black","email":"aeva.online@gmail.com","username":"tenbrae"},"change_message_id":"2675ecef35ee742f376cd6a6f7758c28665d3995","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            raise exc.HTTPNotAcceptable(_("},{"line_number":177,"context_line":"                \"Version %(ver)s was requested but the minor version is not \""},{"line_number":178,"context_line":"                \"supported by this service. Supported range is been returned \""},{"line_number":179,"context_line":"                \"within headers\") % {\u0027ver\u0027: version}, headers\u003dheaders)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    @pecan.expose()"},{"line_number":182,"context_line":"    def _route(self, args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_b8dd0e45","line":179,"updated":"2015-03-04 16:44:58.000000000","message":"I would like to see the min and max versions retained in the message, as well as in the header -- the error message body should be helpful and tell the client why the request was unacceptable. See the HTTP 406 definition http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n\n\"Unless it was a HEAD request, the response SHOULD include an entity containing a list of available entity characteristics and location(s) from which the user or user agent can choose the one most appropriate. \"","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":13362,"name":"Tan Lin","email":"lin.tan@intel.com","username":"zero"},"change_message_id":"e7f441fbd2d87e157a6c67d00069e896c2624bfd","unresolved":false,"context_lines":[{"line_number":176,"context_line":"            raise exc.HTTPNotAcceptable(_("},{"line_number":177,"context_line":"                \"Version %(ver)s was requested but the minor version is not \""},{"line_number":178,"context_line":"                \"supported by this service. Supported range is been returned \""},{"line_number":179,"context_line":"                \"within headers\") % {\u0027ver\u0027: version}, headers\u003dheaders)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    @pecan.expose()"},{"line_number":182,"context_line":"    def _route(self, args):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a80dd14_f8903d50","line":179,"in_reply_to":"9a80dd14_b8dd0e45","updated":"2015-03-05 10:45:08.000000000","message":"Thanks Devananda,  many thing to learn for me :)","commit_id":"aa70eb3214ee4659c80702c9535fa8fb42feb36a"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"10184e6cb1626599088d4ed3b197c9d1bc8f9152","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003dNone):"},{"line_number":168,"context_line":"        if not headers:"},{"line_number":169,"context_line":"            headers \u003d {}"},{"line_number":170,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":171,"context_line":"        if version.major !\u003d BASE_VERSION:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_e4340ee0","line":168,"updated":"2015-03-05 14:44:05.000000000","message":"more specifically, if headers \u003d\u003d None.\n\nWhat you have will also be true in the case where headers \u003d\u003d {}.\n\nThis is probably a nit ;)","commit_id":"32fb6e99a45cfa47650ced901ffadeccae6566de"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"881e881f298b5a5592b992e10565712e287ac3f8","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        return V1.convert()"},{"line_number":166,"context_line":""},{"line_number":167,"context_line":"    def _check_version(self, version, headers\u003dNone):"},{"line_number":168,"context_line":"        if not headers:"},{"line_number":169,"context_line":"            headers \u003d {}"},{"line_number":170,"context_line":"        # ensure that major version in the URL matches the header"},{"line_number":171,"context_line":"        if version.major !\u003d BASE_VERSION:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a80dd14_203fbbd7","line":168,"in_reply_to":"9a80dd14_e4340ee0","updated":"2015-03-06 13:10:19.000000000","message":"honestly I prefer \u0027not headers\u0027, which is a bit shorter, though a bit less efficient :)","commit_id":"32fb6e99a45cfa47650ced901ffadeccae6566de"}],"ironic/tests/api/v1/test_root.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"a61c3458caa232b08ce6f0db971a44aada97c0e0","unresolved":false,"context_lines":[{"line_number":62,"context_line":"                webob_exc.HTTPNotAcceptable,"},{"line_number":63,"context_line":"                v1_api.Controller()._check_version,"},{"line_number":64,"context_line":"                self.version, {\u0027fake-headers\u0027: v1_api.MAX_VER.minor})"},{"line_number":65,"context_line":"        self.assertEqual(e.headers[\u0027fake-headers\u0027], v1_api.MAX_VER.minor)"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"    def test_check_version_ok(self):"},{"line_number":68,"context_line":"        self.version.major \u003d v1_api.BASE_VERSION"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba7be1f8_5c9624f1","line":65,"updated":"2015-03-03 20:41:45.000000000","message":"the ordering is self.assertEqual(\u003cexpected\u003e, \u003cactual\u003e) so reverse this.","commit_id":"5979bc95752299ea62178aa01d2d3960dc86a924"}]}
