)]}'
{"sysinv/cgts-client/cgts-client/cgtsclient/common/http.py":[{"author":{"_account_id":15435,"name":"Al Bailey","email":"albailey1974@gmail.com","username":"albailey"},"change_message_id":"0ee2c7e14d17e1ea6effddd95fc452b0763f5b55","unresolved":true,"context_lines":[{"line_number":405,"context_line":"            error_json \u003d self._extract_error_json(body_str)"},{"line_number":406,"context_line":"            raise exceptions.Forbidden(error_json.get(\u0027faultstring\u0027))"},{"line_number":407,"context_line":"        elif 400 \u003c\u003d status_code \u003c 600:"},{"line_number":408,"context_line":"            _logger.warn(\"Request returned failure status: %s\", status_code)  # pylint: disable\u003ddeprecated-method"},{"line_number":409,"context_line":"            error_json \u003d self._extract_error_json(body_str)"},{"line_number":410,"context_line":"            raise exceptions.from_response("},{"line_number":411,"context_line":"                resp, error_json.get(\u0027faultstring\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"be1a2651_04421506","line":408,"range":{"start_line":408,"start_character":88,"end_line":408,"end_character":113},"updated":"2022-06-15 15:57:48.000000000","message":"un-related to you change\n\nthe deprecation here is \u0027warn\u0027 is now \u0027warning\u0027","commit_id":"edd548d8c165ac13d148c2c5d560bd098e345cc3"}],"sysinv/cgts-client/cgts-client/cgtsclient/exc.py":[{"author":{"_account_id":33608,"name":"Gabriel Silva Trevisan","display_name":"Gabriel Silva Trevisan","email":"gabriel.silvatrevisan@windriver.com","username":"gtrevisan"},"change_message_id":"50dd477a05145f8523a65db986b6895ac506bc6c","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    elif hasattr(response, \u0027status_int\u0027):"},{"line_number":161,"context_line":"        cls \u003d _code_map.get(response.status_int, HTTPException)"},{"line_number":162,"context_line":"    elif hasattr(response, \u0027status\u0027):"},{"line_number":163,"context_line":"        cls \u003d _code_map.get(response.status, HTTPException)"},{"line_number":164,"context_line":"    else:"},{"line_number":165,"context_line":"        # No status code: return a generic exception"},{"line_number":166,"context_line":"        return Exception(\"Unexpected error in response: %s\" % message)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ea62a91c_c5fa07c9","line":163,"updated":"2022-06-14 21:20:39.000000000","message":"nit: Not too familiar with this part of the code, but just pointing out, it appears that http.py also has a get_status_code method we might want to reuse.\n\nIt doesn\u0027t have the status_code check like we have here, though, so if we decide to use it, we might need to confirm if adding it there makes sense.\n\nhttps://github.com/starlingx/config/blob/master/sysinv/cgts-client/cgts-client/cgtsclient/common/http.py#L663","commit_id":"edd548d8c165ac13d148c2c5d560bd098e345cc3"},{"author":{"_account_id":33608,"name":"Gabriel Silva Trevisan","display_name":"Gabriel Silva Trevisan","email":"gabriel.silvatrevisan@windriver.com","username":"gtrevisan"},"change_message_id":"74a3303e4bb44d32fb541cb8e0e335433790e0c9","unresolved":false,"context_lines":[{"line_number":160,"context_line":"    elif hasattr(response, \u0027status_int\u0027):"},{"line_number":161,"context_line":"        cls \u003d _code_map.get(response.status_int, HTTPException)"},{"line_number":162,"context_line":"    elif hasattr(response, \u0027status\u0027):"},{"line_number":163,"context_line":"        cls \u003d _code_map.get(response.status, HTTPException)"},{"line_number":164,"context_line":"    else:"},{"line_number":165,"context_line":"        # No status code: return a generic exception"},{"line_number":166,"context_line":"        return Exception(\"Unexpected error in response: %s\" % message)"}],"source_content_type":"text/x-python","patch_set":2,"id":"afa4e6b8_f3801499","line":163,"in_reply_to":"0227e28f_6d343801","updated":"2022-06-14 22:23:12.000000000","message":"Makes sense, I agree with keeping the change simple for this one.","commit_id":"edd548d8c165ac13d148c2c5d560bd098e345cc3"},{"author":{"_account_id":33549,"name":"Kyle MacLeod","email":"Kyle.MacLeod@windriver.com","username":"kmacleod"},"change_message_id":"d704e4f0c93692204bbf05b2daece5b81b753427","unresolved":true,"context_lines":[{"line_number":160,"context_line":"    elif hasattr(response, \u0027status_int\u0027):"},{"line_number":161,"context_line":"        cls \u003d _code_map.get(response.status_int, HTTPException)"},{"line_number":162,"context_line":"    elif hasattr(response, \u0027status\u0027):"},{"line_number":163,"context_line":"        cls \u003d _code_map.get(response.status, HTTPException)"},{"line_number":164,"context_line":"    else:"},{"line_number":165,"context_line":"        # No status code: return a generic exception"},{"line_number":166,"context_line":"        return Exception(\"Unexpected error in response: %s\" % message)"}],"source_content_type":"text/x-python","patch_set":2,"id":"0227e28f_6d343801","line":163,"in_reply_to":"ea62a91c_c5fa07c9","updated":"2022-06-14 21:50:18.000000000","message":"I did consider this, but it makes the change a lot bigger, and requires a lot more testing. We would need to refactor the get_status_code outside of the HTTPClient class in order to use it as a common utility. An alternative would be to pass the error code into the from_response method directly from code within the HTTPClient calls.\n\nIt may make sense to add a check for hasattr(response, \u0027status_code\u0027) in that HTTPClient code, although again, I\u0027m reluctant to change anything in that code path at this time.","commit_id":"edd548d8c165ac13d148c2c5d560bd098e345cc3"}]}
