)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"33d13243e60c2bf5e6450b22bd62aa07197d8718","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add config option to limit max stacks per tenant"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tenants will not be able to create mor than max_stacks_per_tenant top"},{"line_number":10,"context_line":"level stacks. This should prevent any one tenant from being able to"},{"line_number":11,"context_line":"exhaust a Heat engine\u0027s resources."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAS3%2F%2F880%3D","line":9,"updated":"2013-09-16 17:21:48.000000000","message":"typo s/mor/more ;)","commit_id":"ce1381a459820748b23d85efc486030e65da9d65"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"4762071a58354966fcb9ef93441660a0b0ad3586","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add config option to limit max stacks per tenant"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Tenants will not be able to create mor than max_stacks_per_tenant top"},{"line_number":10,"context_line":"level stacks. This should prevent any one tenant from being able to"},{"line_number":11,"context_line":"exhaust a Heat engine\u0027s resources."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"AAAAS3%2F%2FwTM%3D","line":9,"in_reply_to":"AAAAS3%2F%2F880%3D","updated":"2013-09-19 21:19:12.000000000","message":"Done","commit_id":"ce1381a459820748b23d85efc486030e65da9d65"}],"heat/common/exception.py":[{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"33d13243e60c2bf5e6450b22bd62aa07197d8718","unresolved":false,"context_lines":[{"line_number":332,"context_line":"        super(StackRecursionLimitReached, self).__init__()"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"class StacksPerTenantLimitReached(HeatException):"},{"line_number":336,"context_line":"    message \u003d _(\"You have reached the maximum stacks per tenant, %d. Please\""},{"line_number":337,"context_line":"                \" delete some stacks.\")"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2F88M%3D","line":335,"updated":"2013-09-16 17:21:48.000000000","message":"This should probably just be RequestLimitExceeded, now we\u0027ve merged:\n\nhttps://review.openstack.org/#/c/44803/","commit_id":"ce1381a459820748b23d85efc486030e65da9d65"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"4762071a58354966fcb9ef93441660a0b0ad3586","unresolved":false,"context_lines":[{"line_number":332,"context_line":"        super(StackRecursionLimitReached, self).__init__()"},{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"class StacksPerTenantLimitReached(HeatException):"},{"line_number":336,"context_line":"    message \u003d _(\"You have reached the maximum stacks per tenant, %d. Please\""},{"line_number":337,"context_line":"                \" delete some stacks.\")"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAS3%2F%2FwTY%3D","line":335,"in_reply_to":"AAAAS3%2F%2F88M%3D","updated":"2013-09-19 21:19:12.000000000","message":"I made this extend RequestLimitExceeded. I\u0027m not sure it will actually result in the right error code for HTTP, but I think it is a valid approach. This error message doesn\u0027t need to be pushed out to all of the places that may arrive at this error state, so I don\u0027t really agree that a generic exception should be the only one allowed to be raised out in the code.","commit_id":"ce1381a459820748b23d85efc486030e65da9d65"},{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"645be4160a84d540092458670e258681064f79b2","unresolved":false,"context_lines":[{"line_number":331,"context_line":"    message \u003d _(\u0027Maximum resources per stack exceeded.\u0027)"},{"line_number":332,"context_line":""},{"line_number":333,"context_line":""},{"line_number":334,"context_line":"class StackRecursionLimitReached(HeatException):"},{"line_number":335,"context_line":"    message \u003d _(\"Recursion depth exceeds %d.\")"},{"line_number":336,"context_line":""},{"line_number":337,"context_line":"    def __init__(self, recursion_depth):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAS3%2F%2FoTw%3D","line":334,"updated":"2013-09-23 18:04:32.000000000","message":"This appears unrelated to the rest of the patch?\n\nAlso I thought we were aligning with RequestLimitExceeded rather than having separate exceptions for every possible type of limit?\n\nhttps://review.openstack.org/#/c/44803/","commit_id":"8b6e42bd8696e79459124e409008d06ae2d14496"}],"heat/engine/service.py":[{"author":{"_account_id":4328,"name":"Steven Hardy","email":"steven.hardy@suse.com","username":"shardy"},"change_message_id":"f939ee09578db388ac3de464f5e953e3f23c9ed6","unresolved":false,"context_lines":[{"line_number":252,"context_line":"            raise exception.StackExists(stack_name\u003dstack_name)"},{"line_number":253,"context_line":"        tenant_limit \u003d cfg.CONF.max_stacks_per_tenant"},{"line_number":254,"context_line":"        if db_api.stack_count_all_by_tenant(cnxt) \u003e\u003d tenant_limit:"},{"line_number":255,"context_line":"            raise exception.StacksPerTenantLimitReached(tenant_limit)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        tmpl \u003d parser.Template(template, files\u003dfiles)"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FhbI%3D","line":255,"updated":"2013-09-25 09:26:57.000000000","message":"Hmm, so the problem with adding all these new exception types, is we fail to map them correctly in the API - AFAICT all the recent limit-orientated exceptions result in a 500 response from both the native and CFN API\u0027s\n\nIMO the way forward is to add RequestLimitExceeded to the response mappings in both APIs, then use that exception when we fail some criteria related to limiting-all-the-things.\n\nOtherwise, we have to remember to add every new exception to these mappings (which we\u0027ve failed to do in all cases recently..):\n\nhttps://github.com/openstack/heat/blob/master/heat/api/aws/exception.py#L250\n\nand I guess in api/middleware/fault.py, which has been reworked removing the previous openstack/v1/util.py remote_error mapping.  Sigh.","commit_id":"001fb1946e9f253c1a9d76d4f7917175e39b3795"},{"author":{"_account_id":6488,"name":"Clint Byrum","email":"clint@fewbar.com","username":"clint-fewbar"},"change_message_id":"b9b287f8817b34945da18cd44a4561516dc00698","unresolved":false,"context_lines":[{"line_number":252,"context_line":"            raise exception.StackExists(stack_name\u003dstack_name)"},{"line_number":253,"context_line":"        tenant_limit \u003d cfg.CONF.max_stacks_per_tenant"},{"line_number":254,"context_line":"        if db_api.stack_count_all_by_tenant(cnxt) \u003e\u003d tenant_limit:"},{"line_number":255,"context_line":"            raise exception.StacksPerTenantLimitReached(tenant_limit)"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        tmpl \u003d parser.Template(template, files\u003dfiles)"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAS3%2F%2FgQQ%3D","line":255,"in_reply_to":"AAAAS3%2F%2FhbI%3D","updated":"2013-09-25 15:40:50.000000000","message":"Alright, I made an assumption about it, and it seems the error mapping is more naive than I thought (not using isinstance, but instead just looking up the explicit type in a map).\n\nI\u0027d rather see a gathering of error messages as exceptions though, so I think the right thing long term is to make the error mapping smarter and have exceptions extend a base exception that will control the error code. Short term, I will yield, and push the message in from the raise spot + test it in the unit tests. :-/","commit_id":"001fb1946e9f253c1a9d76d4f7917175e39b3795"}]}
