)]}'
{"tempest/common/rest_client.py":[{"author":{"_account_id":1192,"name":"David Kranz","email":"dkranz@redhat.com","username":"david-kranz"},"change_message_id":"36cb5f7874500b2464e0b81268c7328a31e85e60","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                            message \u003d resp_body[\u0027computeFault\u0027][\u0027message\u0027]"},{"line_number":555,"context_line":"                        elif \u0027error\u0027 in resp_body:  # Keystone errors"},{"line_number":556,"context_line":"                            message \u003d resp_body[\u0027error\u0027][\u0027message\u0027]"},{"line_number":557,"context_line":"                            raise exceptions.Unauthorized(message)"},{"line_number":558,"context_line":"                        elif \u0027message\u0027 in resp_body:"},{"line_number":559,"context_line":"                            message \u003d resp_body[\u0027message\u0027]"},{"line_number":560,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_ae2725b5","line":557,"updated":"2014-12-10 15:37:22.000000000","message":"It looks like the intent of all this code is to extract an error message from a somewhat unstructured set of possible response bodies. If the response was 500 we should fall through to raise the ServerFault. For 501 it is less clear whether to fall through or return IdentityError but IMO Unauthorized cannot be inferred.","commit_id":"5c0ea1a69318bee77f869d639d6315f9a062558b"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"14e763f7e25eb689d4ea70c3d3a4cf3882c72467","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                            message \u003d resp_body[\u0027computeFault\u0027][\u0027message\u0027]"},{"line_number":555,"context_line":"                        elif \u0027error\u0027 in resp_body:  # Keystone errors"},{"line_number":556,"context_line":"                            message \u003d resp_body[\u0027error\u0027][\u0027message\u0027]"},{"line_number":557,"context_line":"                            raise exceptions.Unauthorized(message)"},{"line_number":558,"context_line":"                        elif \u0027message\u0027 in resp_body:"},{"line_number":559,"context_line":"                            message \u003d resp_body[\u0027message\u0027]"},{"line_number":560,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_d7014b06","line":557,"in_reply_to":"3a961159_5caf422a","updated":"2014-12-11 05:15:24.000000000","message":"501 is \"Not Implemented\",  so I feel we need a new exception NotImplemented for this.","commit_id":"5c0ea1a69318bee77f869d639d6315f9a062558b"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"8700cf8ba69d4046283d9a263d442b0f0046b627","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                            message \u003d resp_body[\u0027computeFault\u0027][\u0027message\u0027]"},{"line_number":555,"context_line":"                        elif \u0027error\u0027 in resp_body:  # Keystone errors"},{"line_number":556,"context_line":"                            message \u003d resp_body[\u0027error\u0027][\u0027message\u0027]"},{"line_number":557,"context_line":"                            raise exceptions.Unauthorized(message)"},{"line_number":558,"context_line":"                        elif \u0027message\u0027 in resp_body:"},{"line_number":559,"context_line":"                            message \u003d resp_body[\u0027message\u0027]"},{"line_number":560,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_bcbe6663","line":557,"in_reply_to":"3a961159_ae2725b5","updated":"2014-12-11 05:06:03.000000000","message":"@David\n\nThanks for your comment, that helps me for considering this code.\nSo this part(line548-557) seems just for extracting error message as you said, and the type of exception should be based on resp.status code.\nI will apply this to next patch, thank you so much!","commit_id":"5c0ea1a69318bee77f869d639d6315f9a062558b"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"35f54b05861a769065afbb93a9b233a97fdcba08","unresolved":false,"context_lines":[{"line_number":554,"context_line":"                            message \u003d resp_body[\u0027computeFault\u0027][\u0027message\u0027]"},{"line_number":555,"context_line":"                        elif \u0027error\u0027 in resp_body:  # Keystone errors"},{"line_number":556,"context_line":"                            message \u003d resp_body[\u0027error\u0027][\u0027message\u0027]"},{"line_number":557,"context_line":"                            raise exceptions.Unauthorized(message)"},{"line_number":558,"context_line":"                        elif \u0027message\u0027 in resp_body:"},{"line_number":559,"context_line":"                            message \u003d resp_body[\u0027message\u0027]"},{"line_number":560,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a961159_5caf422a","line":557,"in_reply_to":"3a961159_bcbe6663","updated":"2014-12-11 05:06:32.000000000","message":"ref: https://review.openstack.org/#/c/9501/ has added the above code.","commit_id":"5c0ea1a69318bee77f869d639d6315f9a062558b"},{"author":{"_account_id":8859,"name":"Daisuke Morita","email":"morita.daisuke@ntti3.com","username":"morrisson"},"change_message_id":"21e85aa83009f255d217124a31ef1a25decbd2f7","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            if resp.status \u003d\u003d 500:"},{"line_number":550,"context_line":"                raise exceptions.ServerFault(message)"},{"line_number":551,"context_line":"            else:"},{"line_number":552,"context_line":"                raise exceptions.NotImplemented(message)"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"        if resp.status \u003e\u003d 400:"},{"line_number":555,"context_line":"            raise exceptions.UnexpectedResponseCode(str(resp.status))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_91718c78","line":552,"updated":"2014-12-11 09:19:37.000000000","message":"Generally speaking, 501, 502, 503, ... are more specific statuses than 500, so we should check 501 first here.","commit_id":"133e384bfe63f4673db9dab6a143662e290bd3e7"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"b507f9a0647cc44926e862ba959ff7ed96d50467","unresolved":false,"context_lines":[{"line_number":549,"context_line":"            if resp.status \u003d\u003d 500:"},{"line_number":550,"context_line":"                raise exceptions.ServerFault(message)"},{"line_number":551,"context_line":"            else:"},{"line_number":552,"context_line":"                raise exceptions.NotImplemented(message)"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"        if resp.status \u003e\u003d 400:"},{"line_number":555,"context_line":"            raise exceptions.UnexpectedResponseCode(str(resp.status))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_d4c30255","line":552,"in_reply_to":"3a961159_91718c78","updated":"2014-12-11 09:52:31.000000000","message":"Nice point, I will apply it on the next patch.\n\nThanks","commit_id":"133e384bfe63f4673db9dab6a143662e290bd3e7"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"41d0f882bcbe6d552de8d013f1ecfcd3923d074d","unresolved":false,"context_lines":[{"line_number":540,"context_line":"                        elif \u0027computeFault\u0027 in resp_body:"},{"line_number":541,"context_line":"                            message \u003d resp_body[\u0027computeFault\u0027][\u0027message\u0027]"},{"line_number":542,"context_line":"                        elif \u0027error\u0027 in resp_body:"},{"line_number":543,"context_line":"                            message \u003d resp_body[\u0027error\u0027][\u0027message\u0027]"},{"line_number":544,"context_line":"                        elif \u0027message\u0027 in resp_body:"},{"line_number":545,"context_line":"                            message \u003d resp_body[\u0027message\u0027]"},{"line_number":546,"context_line":"                    else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a961159_39741a35","line":543,"updated":"2014-12-12 08:13:25.000000000","message":"Now it looks good.\nEven it should not be assumed that case \"\u0027error\u0027 in resp_body\" is always from keystone only. We should just extract the error message here as it is done now.\n\nThanks.","commit_id":"43a694a9883d0a4de5dceb5f038f53a767569cbb"}]}
