)]}'
{"nova/api/openstack/compute/contrib/security_groups.py":[{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"c72b03ba94c901571703a935dc196d83d46858a0","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    @staticmethod"},{"line_number":619,"context_line":"    def raise_over_quota(msg):"},{"line_number":620,"context_line":"        raise exc.HTTPRequestEntityTooLarge(explanation\u003dmsg)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    @staticmethod"},{"line_number":623,"context_line":"    def raise_not_found(msg):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fzws%3D","line":620,"updated":"2013-05-22 15:43:36.000000000","message":"Ugh - don\u0027t use this status code, it is meant for something else. see: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html It\u0027s best to use the standard HTTPBadRequest","commit_id":"ae99fc251849af095892ce7399ce34a575ee8e47"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"16a52d96f579cf755950d6b05b1dc4f73a6502cf","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    @staticmethod"},{"line_number":619,"context_line":"    def raise_over_quota(msg):"},{"line_number":620,"context_line":"        raise exc.HTTPRequestEntityTooLarge(explanation\u003dmsg)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    @staticmethod"},{"line_number":623,"context_line":"    def raise_not_found(msg):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FumY%3D","line":620,"in_reply_to":"AAAAPH%2F%2Fyj0%3D","updated":"2013-05-24 10:51:56.000000000","message":"So you are right - but the reason API returns a 413 is becuase if you raise a QuotaError in the API and don\u0027t handle it, it\u0027s status code is set by default to 413, and Resource App will not handle it and it will bubble up through middlewares all the way to the FaultWrapper app which will copy it\u0027s code to the Fault object and return that to the user. Fault wrapper is the place where the exception is logged.\n\nBased on the above - I think this solution is a bit brute-forced, and I\u0027d prefer security group API class to handle this like all others - namely raise an actual Nova exeption that is handled in the controller method and the proper HTTP* exception raised there.\n\nA more elegant solution would be to handle this exception in the Resource class, or namely in the ResourceExceptionHandler context manager class, by adding another clause in the __exit__ method that will check for QuotaErrors and convert them to Faults there.","commit_id":"ae99fc251849af095892ce7399ce34a575ee8e47"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"8b811bd05974bd9c18777a5741f0eadd6f041fd8","unresolved":false,"context_lines":[{"line_number":617,"context_line":""},{"line_number":618,"context_line":"    @staticmethod"},{"line_number":619,"context_line":"    def raise_over_quota(msg):"},{"line_number":620,"context_line":"        raise exc.HTTPRequestEntityTooLarge(explanation\u003dmsg)"},{"line_number":621,"context_line":""},{"line_number":622,"context_line":"    @staticmethod"},{"line_number":623,"context_line":"    def raise_not_found(msg):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fyj0%3D","line":620,"in_reply_to":"AAAAPH%2F%2Fzws%3D","updated":"2013-05-22 23:14:00.000000000","message":"Unfortunately 413 is what is currently returned by the v2 API (this is what SecurityGroupLimitedExceeded gets translated to) so this has to stay for now, but can be fixed up in the v3 API.\n\nThis patch doesn\u0027t try to fix up the API, just remove the stacktrace from being generated in the logs","commit_id":"ae99fc251849af095892ce7399ce34a575ee8e47"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"36ec0ac0fe1e102271247535de2bc75571de700c","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            group_ref \u003d self.security_group_api.create_security_group("},{"line_number":294,"context_line":"                context, group_name, group_description)"},{"line_number":295,"context_line":"        except exception.SecurityGroupLimitExceeded as err:"},{"line_number":296,"context_line":"            raise exc.HTTPRequestEntityTooLarge(explanation\u003dstr(err))"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        return {\u0027security_group\u0027: self._format_security_group(context,"},{"line_number":299,"context_line":"                                                              group_ref)}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2F5Kw%3D","line":296,"updated":"2013-06-06 16:05:48.000000000","message":"It should be \u0027explanation\u003derr.message\u0027 ? I am doing a quick test as below:\n\nIn [11]: import gettext\n\nIn [12]: gettext.install(\u0027nova\u0027, unicode\u003d1)\n\nIn [13]: import nova.exception\n\nIn [16]: str(nova.exception.SecurityGroupLimitExceeded)\nOut[16]: \"\u003cclass \u0027nova.exception.SecurityGroupLimitExceeded\u0027\u003e\"","commit_id":"94e0dad384c808fd4a5d795c5dc9ed219fd0084e"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"14e9d43be6888c85fe57d33752c4157834052938","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            group_ref \u003d self.security_group_api.create_security_group("},{"line_number":294,"context_line":"                context, group_name, group_description)"},{"line_number":295,"context_line":"        except exception.SecurityGroupLimitExceeded as err:"},{"line_number":296,"context_line":"            raise exc.HTTPRequestEntityTooLarge(explanation\u003dstr(err))"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        return {\u0027security_group\u0027: self._format_security_group(context,"},{"line_number":299,"context_line":"                                                              group_ref)}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2F3u8%3D","line":296,"in_reply_to":"AAAAPX%2F%2F5E4%3D","updated":"2013-06-07 00:45:43.000000000","message":"Done","commit_id":"94e0dad384c808fd4a5d795c5dc9ed219fd0084e"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"af691329f9e41bc4fe867cf6c9ded7970d3dca65","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            group_ref \u003d self.security_group_api.create_security_group("},{"line_number":294,"context_line":"                context, group_name, group_description)"},{"line_number":295,"context_line":"        except exception.SecurityGroupLimitExceeded as err:"},{"line_number":296,"context_line":"            raise exc.HTTPRequestEntityTooLarge(explanation\u003dstr(err))"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"        return {\u0027security_group\u0027: self._format_security_group(context,"},{"line_number":299,"context_line":"                                                              group_ref)}"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2F5E4%3D","line":296,"in_reply_to":"AAAAPX%2F%2F5Kw%3D","updated":"2013-06-06 16:32:15.000000000","message":"Actually, that\u0027s a good point; the nova interface for this is to call the format_message() method of the exception; so the line should be:\n\n    raise exc.HTTPRequestEntityTooLarge(explanation\u003derr.format_message())","commit_id":"94e0dad384c808fd4a5d795c5dc9ed219fd0084e"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"36ec0ac0fe1e102271247535de2bc75571de700c","unresolved":false,"context_lines":[{"line_number":364,"context_line":"                self.security_group_api.create_security_group_rule("},{"line_number":365,"context_line":"                    context, security_group, new_rule))"},{"line_number":366,"context_line":"        except exception.SecurityGroupLimitExceeded as err:"},{"line_number":367,"context_line":"            raise exc.HTTPRequestEntityTooLarge(explanation\u003dstr(err))"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"        return {\"security_group_rule\": self._format_security_group_rule("},{"line_number":370,"context_line":"                                                        context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2F5Kk%3D","line":367,"updated":"2013-06-06 16:05:48.000000000","message":"ditto","commit_id":"94e0dad384c808fd4a5d795c5dc9ed219fd0084e"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"14e9d43be6888c85fe57d33752c4157834052938","unresolved":false,"context_lines":[{"line_number":364,"context_line":"                self.security_group_api.create_security_group_rule("},{"line_number":365,"context_line":"                    context, security_group, new_rule))"},{"line_number":366,"context_line":"        except exception.SecurityGroupLimitExceeded as err:"},{"line_number":367,"context_line":"            raise exc.HTTPRequestEntityTooLarge(explanation\u003dstr(err))"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"        return {\"security_group_rule\": self._format_security_group_rule("},{"line_number":370,"context_line":"                                                        context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPX%2F%2F3u4%3D","line":367,"in_reply_to":"AAAAPX%2F%2F5Kk%3D","updated":"2013-06-07 00:45:43.000000000","message":"Done","commit_id":"94e0dad384c808fd4a5d795c5dc9ed219fd0084e"}]}
