)]}'
{"tempest/common/rest_client.py":[{"author":{"_account_id":1192,"name":"David Kranz","email":"dkranz@redhat.com","username":"david-kranz"},"change_message_id":"bfd1dc34ae27060301ec1ee6fbe285616fe43fef","unresolved":false,"context_lines":[{"line_number":268,"context_line":"                        delay \u003d resp[\u0027Retry-After\u0027] if \u0027Retry-After\u0027\\"},{"line_number":269,"context_line":"                            in resp else 60"},{"line_number":270,"context_line":"                        time.sleep(int(delay))"},{"line_number":271,"context_line":"                        return self.request(method, url, headers, body,"},{"line_number":272,"context_line":"                                            depth + 1)"},{"line_number":273,"context_line":"                    else:"},{"line_number":274,"context_line":"                        raise exceptions.RateLimitExceeded("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2FoYs%3D","line":271,"updated":"2013-01-11 21:50:08.000000000","message":"Need to pass \u0027wait\u0027 argument.","commit_id":"df4ecb93121fb86c25906bbe347a0f71c86e22df"},{"author":{"_account_id":2238,"name":"rajalakshmi-ganesan","email":"rajalakshmi.girish@hpe.com","username":"rajalakshmi-ganesan"},"change_message_id":"66016373be016cd7c69fc063bce1ccc5cc6ea65f","unresolved":false,"context_lines":[{"line_number":268,"context_line":"                        delay \u003d resp[\u0027Retry-After\u0027] if \u0027Retry-After\u0027\\"},{"line_number":269,"context_line":"                            in resp else 60"},{"line_number":270,"context_line":"                        time.sleep(int(delay))"},{"line_number":271,"context_line":"                        return self.request(method, url, headers, body,"},{"line_number":272,"context_line":"                                            depth + 1)"},{"line_number":273,"context_line":"                    else:"},{"line_number":274,"context_line":"                        raise exceptions.RateLimitExceeded("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Fkwk%3D","line":271,"in_reply_to":"AAAAM3%2F%2FoYs%3D","updated":"2013-01-15 14:09:17.000000000","message":"@David Yes I am confused about wait parameter :-(..So as per your comment corresponding to patch 4, I think we need not pass wait parameter here. Is it enough to do a time.sleep(delay) before we send next request?","commit_id":"df4ecb93121fb86c25906bbe347a0f71c86e22df"},{"author":{"_account_id":2238,"name":"rajalakshmi-ganesan","email":"rajalakshmi.girish@hpe.com","username":"rajalakshmi-ganesan"},"change_message_id":"03d5e7b96ea97b881ffd9ad177820879f3ecd6ed","unresolved":false,"context_lines":[{"line_number":268,"context_line":"                        delay \u003d resp[\u0027Retry-After\u0027] if \u0027Retry-After\u0027\\"},{"line_number":269,"context_line":"                            in resp else 60"},{"line_number":270,"context_line":"                        time.sleep(int(delay))"},{"line_number":271,"context_line":"                        return self.request(method, url, headers, body,"},{"line_number":272,"context_line":"                                            depth + 1)"},{"line_number":273,"context_line":"                    else:"},{"line_number":274,"context_line":"                        raise exceptions.RateLimitExceeded("}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Fk58%3D","line":271,"in_reply_to":"AAAAM3%2F%2FoYs%3D","updated":"2013-01-15 10:53:54.000000000","message":"Passed wait argument to request method. Also added logic in \"def request\" so as to wait before next request if \u0027wait\u0027 argument is not None.","commit_id":"df4ecb93121fb86c25906bbe347a0f71c86e22df"},{"author":{"_account_id":97,"name":"Daryl Walleck","email":"daryl.walleck@rackspace.com","username":"dwalleck"},"change_message_id":"814b20804345c5804be3a1a78fa772be22c5aa1b","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        if resp.status \u003d\u003d 413:"},{"line_number":263,"context_line":"            resp_body \u003d self._parse_resp(resp_body)"},{"line_number":264,"context_line":"            self._log(req_url, body, resp, resp_body)"},{"line_number":265,"context_line":"            if \u0027overLimit\u0027 in resp_body:"},{"line_number":266,"context_line":"                if \u0027retryAfter\u0027 in resp_body[\u0027overLimit\u0027]:"},{"line_number":267,"context_line":"                    if depth \u003c MAX_RECURSION_DEPTH:"},{"line_number":268,"context_line":"                        delay \u003d resp_body[\u0027overLimit\u0027][\u0027retryAfter\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2FinE%3D","line":265,"updated":"2013-01-16 18:51:36.000000000","message":"With the additions in this merge prop I think it would be much easier and readable to refactor this block to start with checking depth \u003c MAX_RECURSION_DEPTH, and then handling the special cases as you go. The logic should compress there should\u0027t be a need for duplicate code","commit_id":"33bc4df28c8730a8a11fa87cc84755a95e0c5af8"},{"author":{"_account_id":2238,"name":"rajalakshmi-ganesan","email":"rajalakshmi.girish@hpe.com","username":"rajalakshmi-ganesan"},"change_message_id":"9c7b5203b244c08ee4a5a5b7eb92ff3279708726","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        if resp.status \u003d\u003d 413:"},{"line_number":263,"context_line":"            resp_body \u003d self._parse_resp(resp_body)"},{"line_number":264,"context_line":"            self._log(req_url, body, resp, resp_body)"},{"line_number":265,"context_line":"            if \u0027overLimit\u0027 in resp_body:"},{"line_number":266,"context_line":"                if \u0027retryAfter\u0027 in resp_body[\u0027overLimit\u0027]:"},{"line_number":267,"context_line":"                    if depth \u003c MAX_RECURSION_DEPTH:"},{"line_number":268,"context_line":"                        delay \u003d resp_body[\u0027overLimit\u0027][\u0027retryAfter\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Fhdw%3D","line":265,"in_reply_to":"AAAAM3%2F%2FinE%3D","updated":"2013-01-17 13:41:49.000000000","message":"Yes Daryl, you are right. The code in this block is a bit messy. The block is so much confusing as the response body of request differs for JSON and XML after parsing. I mean after they return from  \"_parse_resp\" method. (line263).\n\nResponse body of JSON has \u0027overLImit\u0027 key where as XML does not have \u0027overLImit\u0027 key after parsing. Hence is the duplication of code.\n\nMeanwhile, I am in the process of making this block simple.Will submit it soon.\n\nThanks.","commit_id":"33bc4df28c8730a8a11fa87cc84755a95e0c5af8"},{"author":{"_account_id":97,"name":"Daryl Walleck","email":"daryl.walleck@rackspace.com","username":"dwalleck"},"change_message_id":"814b20804345c5804be3a1a78fa772be22c5aa1b","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            self._log(req_url, body, resp, resp_body)"},{"line_number":265,"context_line":"            if \u0027overLimit\u0027 in resp_body:"},{"line_number":266,"context_line":"                if \u0027retryAfter\u0027 in resp_body[\u0027overLimit\u0027]:"},{"line_number":267,"context_line":"                    if depth \u003c MAX_RECURSION_DEPTH:"},{"line_number":268,"context_line":"                        delay \u003d resp_body[\u0027overLimit\u0027][\u0027retryAfter\u0027]"},{"line_number":269,"context_line":"                        time.sleep(int(delay))"},{"line_number":270,"context_line":"                        return self.request(method, url, headers\u003dheaders,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Finw%3D","line":267,"updated":"2013-01-16 18:51:36.000000000","message":"It seems like this could all be combined into a compound statement to avoid nesting if/elses this deep","commit_id":"33bc4df28c8730a8a11fa87cc84755a95e0c5af8"},{"author":{"_account_id":97,"name":"Daryl Walleck","email":"daryl.walleck@rackspace.com","username":"dwalleck"},"change_message_id":"814b20804345c5804be3a1a78fa772be22c5aa1b","unresolved":false,"context_lines":[{"line_number":271,"context_line":"                                            body\u003dbody,"},{"line_number":272,"context_line":"                                            depth\u003ddepth + 1, wait\u003dwait)"},{"line_number":273,"context_line":"                    else:"},{"line_number":274,"context_line":"                        raise exceptions.RateLimitExceeded("},{"line_number":275,"context_line":"                            message\u003dresp_body[\u0027overLimit\u0027][\u0027message\u0027],"},{"line_number":276,"context_line":"                            details\u003dresp_body[\u0027overLimit\u0027][\u0027details\u0027])"},{"line_number":277,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Fimw%3D","line":274,"updated":"2013-01-16 18:51:36.000000000","message":"This block is a duplicate of 289. See other notes, I think we can simplify this","commit_id":"33bc4df28c8730a8a11fa87cc84755a95e0c5af8"},{"author":{"_account_id":97,"name":"Daryl Walleck","email":"daryl.walleck@rackspace.com","username":"dwalleck"},"change_message_id":"814b20804345c5804be3a1a78fa772be22c5aa1b","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            elif \u0027exceeded\u0027 in resp_body[\u0027message\u0027]:"},{"line_number":281,"context_line":"                raise exceptions.OverLimit(resp_body[\u0027message\u0027])"},{"line_number":282,"context_line":"            elif depth \u003c MAX_RECURSION_DEPTH:"},{"line_number":283,"context_line":"                if \u0027retryAfter\u0027 in resp_body:"},{"line_number":284,"context_line":"                    delay \u003d resp_body[\u0027retryAfter\u0027]"},{"line_number":285,"context_line":"                    time.sleep(int(delay))"},{"line_number":286,"context_line":"                    return self.request(method, url, headers\u003dheaders,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAM3%2F%2Fin4%3D","line":283,"updated":"2013-01-16 18:51:36.000000000","message":"There\u0027s no matching else for this case. If retryAfter isn\u0027t in the response body, there would be no retry or exception raised.","commit_id":"33bc4df28c8730a8a11fa87cc84755a95e0c5af8"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"ab115ec38bca06c555079c58b80bac89d5526b6a","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                return self.is_rate_limit_retry_max_recursion_depth("},{"line_number":279,"context_line":"                    resp_body[\u0027overLimit\u0027], method, url, headers,"},{"line_number":280,"context_line":"                    body, depth, wait)"},{"line_number":281,"context_line":"            #Checking whether Absolute/Rate limit for XML requests"},{"line_number":282,"context_line":"            else:"},{"line_number":283,"context_line":"                self.is_absolute_limit(resp_body)"},{"line_number":284,"context_line":"                return self.is_rate_limit_retry_max_recursion_depth("}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAM3%2F%2FYFY%3D","line":281,"updated":"2013-01-24 21:38:23.000000000","message":"I think you should split this if else logic into another method (like _check_overlimit) and then overload it for RestClientXML, something like what is done for _parse_response. The logic here will work but it isn\u0027t entirely intuitive (probably why you put the comments)","commit_id":"98cb7cfe68cfc53f3d87f3707ed15bfe97947c26"}]}
