)]}'
{"nova/api/openstack/compute/contrib/used_limits.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"85072cdd15e193444c9acd8584d36c9d94551c5e","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        try:"},{"line_number":47,"context_line":"            return int(opts[\u0027reserved\u0027])"},{"line_number":48,"context_line":"        except Exception:"},{"line_number":49,"context_line":"            return False"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @wsgi.extends"},{"line_number":52,"context_line":"    def index(self, req, resp_obj):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMX%2F%2F4k8%3D","line":49,"updated":"2012-12-10 21:47:13.000000000","message":"I don\u0027t quite understand this conversion from req.GET to opts.  I would do something like:\n\n    @staticmethod\n    def _reserved(req):\n        try:\n            return int(req.GET[\u0027reserved\u0027])\n        except (ValueError, KeyError):\n            return 0","commit_id":"c81d1d2c568f0b95b4e920f41869b8347ee40592"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"85072cdd15e193444c9acd8584d36c9d94551c5e","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            if quota in quotas:"},{"line_number":69,"context_line":"                used_limits[display_name] \u003d (quotas[quota][\u0027in_use\u0027]"},{"line_number":70,"context_line":"                                             + (quotas[quota][\u0027reserved\u0027]"},{"line_number":71,"context_line":"                                             if self._reserved(req) else 0))"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        resp_obj.obj[\u0027limits\u0027][\u0027absolute\u0027].update(used_limits)"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMX%2F%2F4kg%3D","line":71,"updated":"2012-12-10 21:47:13.000000000","message":"As a suggestion, how about:\n\n    if quota in quotas:\n        reserved \u003d quotas[quota][\u0027reserved\u0027] if self._reserved(req) else 0\n        used_limits[display_name] \u003d quotas[quota][\u0027in_use\u0027] + reserved\n\nI also considered suggesting:\n\n    reserved \u003d quotas[quota][\u0027reserved\u0027] * self._reserved(req)\n\nbut that depends on _reserved(req) returning either 0 or 1, and may be less clear.","commit_id":"c81d1d2c568f0b95b4e920f41869b8347ee40592"}]}
