)]}'
{"ironicclient/common/http.py":[{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"8b65585b505bbd23093054980a75dfea8e0fc0f8","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _extract_error_json(self, body):"},{"line_number":113,"context_line":"        error_json \u003d {}"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            body_json \u003d json.loads(body)"},{"line_number":117,"context_line":"            if \u0027error_message\u0027 in body_json:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9f7A%3D","line":114,"updated":"2014-02-06 14:46:54.000000000","message":"Seems to be an unrelated change","commit_id":"68f8de31effe5176fcb50bdfcc0b0a148b49123c"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"70d49505a46375f8f090523fe3df18451b81cd2c","unresolved":false,"context_lines":[{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _extract_error_json(self, body):"},{"line_number":113,"context_line":"        error_json \u003d {}"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            body_json \u003d json.loads(body)"},{"line_number":117,"context_line":"            if \u0027error_message\u0027 in body_json:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9fpE%3D","line":114,"in_reply_to":"AAAAUH%2F9f7A%3D","updated":"2014-02-06 14:53:55.000000000","message":"this change related to logic of method `from_response` from module `apiclient.exceptions`.","commit_id":"68f8de31effe5176fcb50bdfcc0b0a148b49123c"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"55a65f93b74a89a4b50e4b3e2d43cf405417d750","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            return {}"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        if \u0027faultstring\u0027 in error_json:"},{"line_number":124,"context_line":"            error_json[\u0027message\u0027] \u003d error_json.pop(\u0027faultstring\u0027)"},{"line_number":125,"context_line":"        if \u0027debuginfo\u0027 in error_json:"},{"line_number":126,"context_line":"            error_json[\u0027details\u0027] \u003d error_json.pop(\u0027debuginfo\u0027)"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2F0LQ%3D","line":124,"updated":"2014-02-24 17:14:38.000000000","message":"Please add comment that this is done just to store error message under proper keys","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"},{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"55a65f93b74a89a4b50e4b3e2d43cf405417d750","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # for using methods such as `from_response`, which already use"},{"line_number":174,"context_line":"            # lib `requests` instead of `httplib/httplib2`."},{"line_number":175,"context_line":"            resp.status_code \u003d resp.status"},{"line_number":176,"context_line":"            resp.headers \u003d {\u0027Content-Type\u0027: resp.getheader(\u0027content-type\u0027, \"\")}"},{"line_number":177,"context_line":"            resp.json \u003d lambda: {\u0027error\u0027: self._extract_error_json(body_str)}"},{"line_number":178,"context_line":"            raise exc.from_response(resp, method, url)"},{"line_number":179,"context_line":"        elif resp.status in (301, 302, 305):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2F0Ik%3D","line":176,"updated":"2014-02-24 17:14:38.000000000","message":"Is this the only header that we want to leave? maybe others important too","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"f286cefb372c4f91c7550d37e7131eeda0255324","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            # for using methods such as `from_response`, which already use"},{"line_number":174,"context_line":"            # lib `requests` instead of `httplib/httplib2`."},{"line_number":175,"context_line":"            resp.status_code \u003d resp.status"},{"line_number":176,"context_line":"            resp.headers \u003d {\u0027Content-Type\u0027: resp.getheader(\u0027content-type\u0027, \"\")}"},{"line_number":177,"context_line":"            resp.json \u003d lambda: {\u0027error\u0027: self._extract_error_json(body_str)}"},{"line_number":178,"context_line":"            raise exc.from_response(resp, method, url)"},{"line_number":179,"context_line":"        elif resp.status in (301, 302, 305):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2Frls%3D","line":176,"in_reply_to":"AAAAU3%2F%2F0Ik%3D","updated":"2014-02-25 10:07:14.000000000","message":"This change doesn\u0027t create new object of response, it only modifies existing object due to logic of method `from_response`.\nThis `response` object continues to store all information. Exception, which will be returned by method `from_response`, keeps `response` object[1], so all other parameters of `response` object can be obtained[2] where they are needed.\n\nAlso, please note that method `from_response` which used in this moment [3] doesn\u0027t keep any information about response except status code.\n\nI will try change my note above to be more informative and clear.\n\n[1] - https://github.com/openstack/oslo-incubator/blob/master/openstack/common/apiclient/exceptions.py#L428\n\n[2] - https://github.com/openstack/oslo-incubator/blob/master/openstack/common/apiclient/exceptions.py#L121\n\n[3] - https://github.com/openstack/python-ironicclient/blob/master/ironicclient/exc.py#L157","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7b1e0d6c2b29aa0b178c6e5af44a5025a79acb9e","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            resp.status_code \u003d resp.status"},{"line_number":179,"context_line":"            resp.headers \u003d {\u0027Content-Type\u0027: resp.getheader(\u0027content-type\u0027, \"\")}"},{"line_number":180,"context_line":"            resp.json \u003d lambda: {\u0027error\u0027: self._extract_error_json(body_str)}"},{"line_number":181,"context_line":"            raise exc.from_response(resp, method, url)"},{"line_number":182,"context_line":"        elif resp.status in (301, 302, 305):"},{"line_number":183,"context_line":"            # Redirected. Reissue the request to the new location."},{"line_number":184,"context_line":"            return self._http_request(resp[\u0027location\u0027], method, **kwargs)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2FqnM%3D","line":181,"updated":"2014-04-18 12:31:58.000000000","message":"I would not have hack like this inline, Instead, please provide overriden version of exc.from_response (in `exc` module) which can distinguish different exception types and adapt for them.","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"b31781105a3e26c28c3ec880fbfeb7371995cbcf","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            resp.status_code \u003d resp.status"},{"line_number":179,"context_line":"            resp.headers \u003d {\u0027Content-Type\u0027: resp.getheader(\u0027content-type\u0027, \"\")}"},{"line_number":180,"context_line":"            resp.json \u003d lambda: {\u0027error\u0027: self._extract_error_json(body_str)}"},{"line_number":181,"context_line":"            raise exc.from_response(resp, method, url)"},{"line_number":182,"context_line":"        elif resp.status in (301, 302, 305):"},{"line_number":183,"context_line":"            # Redirected. Reissue the request to the new location."},{"line_number":184,"context_line":"            return self._http_request(resp[\u0027location\u0027], method, **kwargs)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2Fpsk%3D","line":181,"in_reply_to":"AAAAXH%2F%2FqnM%3D","updated":"2014-04-18 14:21:52.000000000","message":"Done","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"}],"ironicclient/exc.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"616161942006587abb825b05dc5a41190d29d88b","unresolved":false,"context_lines":[{"line_number":42,"context_line":"    # NOTE(akurilin): These modifications around response object gives ability"},{"line_number":43,"context_line":"    # to get all necessary information in method `from_response` from common"},{"line_number":44,"context_line":"    # code, which expecting response object from `requests` library instead of"},{"line_number":45,"context_line":"    # object from `httplib/httplib2` library."},{"line_number":46,"context_line":"    response.status_code \u003d response.status"},{"line_number":47,"context_line":"    response.headers \u003d {\u0027Content-Type\u0027: response.getheader(\u0027content-type\u0027, \"\")}"},{"line_number":48,"context_line":"    response.json \u003d lambda: {\u0027error\u0027: error_body}"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAAXH%2F%2FMXM%3D","line":45,"updated":"2014-04-23 12:37:48.000000000","message":"Can we have some type-check or attribute-check here, so that we don\u0027t break handling httplib2 (thus breaking what common code is expected to do)?","commit_id":"7b6712d39bf1a41605f2ac1498d3596a2968868b"}],"ironicclient/excutils.py":[{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"f24d89081141ed448b8aeb7233a6489e7ecf5adc","unresolved":false,"context_lines":[{"line_number":8,"context_line":"#    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT"},{"line_number":9,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":"import inspect"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"import six"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9fXg%3D","line":11,"updated":"2014-02-06 15:22:21.000000000","message":"Should be an empty string before importing :)","commit_id":"1a22510a1e5bf057cd6e2419941fb3b3e8a0eb9d"}],"ironicclient/openstack/common/apiclient/exceptions.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7b1e0d6c2b29aa0b178c6e5af44a5025a79acb9e","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        except ValueError:"},{"line_number":441,"context_line":"            pass"},{"line_number":442,"context_line":"        else:"},{"line_number":443,"context_line":"            if isinstance(body, dict):"},{"line_number":444,"context_line":"                error \u003d list(body.values())[0]"},{"line_number":445,"context_line":"                kwargs[\"message\"] \u003d error.get(\"message\")"},{"line_number":446,"context_line":"                kwargs[\"details\"] \u003d error.get(\"details\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2Fqmc%3D","line":443,"updated":"2014-04-18 12:31:58.000000000","message":"Please leave it as hasattr(body, \"values\"), that;s a bit unpythonic to check for exact type when you actually need only one conforming method.","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"56a02d304df551365d2e3189bf54f228d55e9d77","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        except ValueError:"},{"line_number":441,"context_line":"            pass"},{"line_number":442,"context_line":"        else:"},{"line_number":443,"context_line":"            if isinstance(body, dict):"},{"line_number":444,"context_line":"                error \u003d list(body.values())[0]"},{"line_number":445,"context_line":"                kwargs[\"message\"] \u003d error.get(\"message\")"},{"line_number":446,"context_line":"                kwargs[\"details\"] \u003d error.get(\"details\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2FphI%3D","line":443,"in_reply_to":"AAAAXH%2F%2Fpls%3D","updated":"2014-04-18 14:33:08.000000000","message":"1) No matter what type is actually going (for now!) be there, it\u0027s not generally common for Python code to do isinstance unless _absolutely_ required. Being exactly dict (not another mapping-like) is not a requirement here. Just treat it as anti-pattern :)\n\n2) But ok, if that\u0027s from oslo code, let it be","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"b31781105a3e26c28c3ec880fbfeb7371995cbcf","unresolved":false,"context_lines":[{"line_number":440,"context_line":"        except ValueError:"},{"line_number":441,"context_line":"            pass"},{"line_number":442,"context_line":"        else:"},{"line_number":443,"context_line":"            if isinstance(body, dict):"},{"line_number":444,"context_line":"                error \u003d list(body.values())[0]"},{"line_number":445,"context_line":"                kwargs[\"message\"] \u003d error.get(\"message\")"},{"line_number":446,"context_line":"                kwargs[\"details\"] \u003d error.get(\"details\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2Fpls%3D","line":443,"in_reply_to":"AAAAXH%2F%2Fqmc%3D","updated":"2014-04-18 14:21:52.000000000","message":"1) Based on the fact that method `json()`(Look at line 439) returns dictionary or string, I prefer to use `isinstance` here because this function is more clear way to understand what kind of body we have.\n2) This change comes from oslo, so it must be changed there if it necessary.","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"}],"ironicclient/tests/test_http.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"7b1e0d6c2b29aa0b178c6e5af44a5025a79acb9e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                                  \u0027GET\u0027, \u0027/v1/resources\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        self.assertEqual(error_msg + \u0027 (HTTP 500)\u0027 + \"\\n\" + error_trace,"},{"line_number":106,"context_line":"                         str(error) + \"\\n\" + str(error.details))"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2Fql4%3D","line":106,"updated":"2014-04-18 12:31:58.000000000","message":"Please change this to using string formatting.","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"b31781105a3e26c28c3ec880fbfeb7371995cbcf","unresolved":false,"context_lines":[{"line_number":103,"context_line":"                                  \u0027GET\u0027, \u0027/v1/resources\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        self.assertEqual(error_msg + \u0027 (HTTP 500)\u0027 + \"\\n\" + error_trace,"},{"line_number":106,"context_line":"                         str(error) + \"\\n\" + str(error.details))"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAXH%2F%2Fpsg%3D","line":106,"in_reply_to":"AAAAXH%2F%2Fql4%3D","updated":"2014-04-18 14:21:52.000000000","message":"Done","commit_id":"dd155c2c22b73c8ad15a3d7f0bc39b6cc9c986e4"}],"ironicclient/tests/test_utils.py":[{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"8b65585b505bbd23093054980a75dfea8e0fc0f8","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import six"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9fsQ%3D","line":15,"updated":"2014-02-06 14:46:54.000000000","message":"Should be one blank line before importing","commit_id":"68f8de31effe5176fcb50bdfcc0b0a148b49123c"},{"author":{"_account_id":8412,"name":"Mike Durnosvistov","email":"glacierr.dev@gmail.com","username":"mdurnosvistov"},"change_message_id":"f24d89081141ed448b8aeb7233a6489e7ecf5adc","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the"},{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"import six"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9fW4%3D","line":15,"updated":"2014-02-06 15:22:21.000000000","message":"ditto","commit_id":"1a22510a1e5bf057cd6e2419941fb3b3e8a0eb9d"}],"ironicclient/v1/chassis.py":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"55a65f93b74a89a4b50e4b3e2d43cf405417d750","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            if key in CREATION_ATTRIBUTES:"},{"line_number":53,"context_line":"                new[key] \u003d value"},{"line_number":54,"context_line":"            else:"},{"line_number":55,"context_line":"                raise exceptions.BadRequest()"},{"line_number":56,"context_line":"        return self._create(self._path(), new)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def delete(self, chassis_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2F0FM%3D","line":55,"updated":"2014-02-24 17:14:38.000000000","message":"Bad request means that there was a request, and server responded that there\u0027s an error, while InvalidAttribute is a Client Error - e.g. no request was performed.\n\nclass InvalidAttribute(ClientException):\t\t\n\t    pass","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"},{"author":{"_account_id":9545,"name":"Andriy Kurilin","email":"andr.kurilin@gmail.com","username":"akurilin"},"change_message_id":"f286cefb372c4f91c7550d37e7131eeda0255324","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            if key in CREATION_ATTRIBUTES:"},{"line_number":53,"context_line":"                new[key] \u003d value"},{"line_number":54,"context_line":"            else:"},{"line_number":55,"context_line":"                raise exceptions.BadRequest()"},{"line_number":56,"context_line":"        return self._create(self._path(), new)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def delete(self, chassis_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2FrXY%3D","line":55,"in_reply_to":"AAAAU3%2F%2F0FM%3D","updated":"2014-02-25 10:07:14.000000000","message":"This make sense, but I prefer to use `BadRequest` because it similar to `InvalidAttribute`, except your note and if we abandon usage of `InvalidAttribute`, we have the opportunity to remove custom module `exception`.\n\nIf you want prevent mistaken interpretation of the meaning this exception, maybe it would be better only to add message to exception. What you think about it?","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"}],"ironicclient/v1/node.py":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"55a65f93b74a89a4b50e4b3e2d43cf405417d750","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            if key in CREATION_ATTRIBUTES:"},{"line_number":69,"context_line":"                new[key] \u003d value"},{"line_number":70,"context_line":"            else:"},{"line_number":71,"context_line":"                raise exceptions.BadRequest()"},{"line_number":72,"context_line":"        return self._create(self._path(), new)"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def delete(self, node_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2F0Ck%3D","line":71,"updated":"2014-02-24 17:14:38.000000000","message":"ditto","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"}],"ironicclient/v1/port.py":[{"author":{"_account_id":8968,"name":"Max Lobur","email":"max_lobur@outlook.com","username":"max_lobur"},"change_message_id":"55a65f93b74a89a4b50e4b3e2d43cf405417d750","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            if key in CREATION_ATTRIBUTES:"},{"line_number":48,"context_line":"                new[key] \u003d value"},{"line_number":49,"context_line":"            else:"},{"line_number":50,"context_line":"                raise exceptions.BadRequest()"},{"line_number":51,"context_line":"        return self._create(self._path(), new)"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"    def delete(self, port_id):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAU3%2F%2F0Cc%3D","line":50,"updated":"2014-02-24 17:14:38.000000000","message":"ditto","commit_id":"7fb1868ac994ba14edb91ccf406374a9a180ab5c"}]}
