)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"c6a87b344bc2d765082bb180b9c799b26ffe3055","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This change refactors SecurityGroupAPI to raise nova"},{"line_number":20,"context_line":"exceptions which are translated to http exceptions in"},{"line_number":21,"context_line":"the security group wsgi extension."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Fixes bug 1183347"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAPn%2F%2F%2FQQ%3D","line":21,"updated":"2013-06-15 06:35:48.000000000","message":"The commit message does not appear to match what\u0027s happening in the code.  The patch is only translating nova exceptions in to http exceptions.  There\u0027s no SecurityGroupAPI refactoring that I see.","commit_id":"8d6eecd7cc2af6a6cb3ce7275c9d2222c677380d"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"031ed21d59ff5a42b3291ca52d85484e931c4499","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This change refactors SecurityGroupAPI to raise nova"},{"line_number":20,"context_line":"exceptions which are translated to http exceptions in"},{"line_number":21,"context_line":"the security group wsgi extension."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Fixes bug 1183347"},{"line_number":24,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"AAAAPn%2F%2F%2B58%3D","line":21,"in_reply_to":"AAAAPn%2F%2F%2FQQ%3D","updated":"2013-06-15 17:29:43.000000000","message":"The NativeNovaSecurityGroupAPI and NativeQuantumSecurityGroupAPI inherit from NativeSecurityGroupExceptions and call its static methods to raise exceptions.","commit_id":"8d6eecd7cc2af6a6cb3ce7275c9d2222c677380d"}],"nova/api/openstack/compute/contrib/security_groups.py":[{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"50525e4fa54c75f88423d883e24b3ec170065c02","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            return func(*args, **kwargs)"},{"line_number":235,"context_line":"        except exception.Invalid as exp:"},{"line_number":236,"context_line":"            msg \u003d exp.format_message()"},{"line_number":237,"context_line":"            raise exc.HTTPBadRequest(msg)"},{"line_number":238,"context_line":"        except exception.NotFound as exp:"},{"line_number":239,"context_line":"            msg \u003d exp.format_message()"},{"line_number":240,"context_line":"            raise exc.HTTPNotFound(msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2F6Jg%3D","line":237,"updated":"2013-06-06 08:40:29.000000000","message":"I think that should be raise exc.HTTPBadRequest(explanation\u003dmsg)\nSimilarly for HTTPNotFound below","commit_id":"4fb80bff2a50c757096cd39500e534b471ae6e37"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cc85fdccd22daf4b4159b7211bf8de0117bf917d","unresolved":false,"context_lines":[{"line_number":234,"context_line":"            return func(*args, **kwargs)"},{"line_number":235,"context_line":"        except exception.Invalid as exp:"},{"line_number":236,"context_line":"            msg \u003d exp.format_message()"},{"line_number":237,"context_line":"            raise exc.HTTPBadRequest(msg)"},{"line_number":238,"context_line":"        except exception.NotFound as exp:"},{"line_number":239,"context_line":"            msg \u003d exp.format_message()"},{"line_number":240,"context_line":"            raise exc.HTTPNotFound(msg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2F44k%3D","line":237,"in_reply_to":"AAAAPX%2F%2F6Jg%3D","updated":"2013-06-06 17:30:11.000000000","message":"Done","commit_id":"4fb80bff2a50c757096cd39500e534b471ae6e37"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"50525e4fa54c75f88423d883e24b3ec170065c02","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        except exception.Invalid as exp:"},{"line_number":236,"context_line":"            msg \u003d exp.format_message()"},{"line_number":237,"context_line":"            raise exc.HTTPBadRequest(msg)"},{"line_number":238,"context_line":"        except exception.NotFound as exp:"},{"line_number":239,"context_line":"            msg \u003d exp.format_message()"},{"line_number":240,"context_line":"            raise exc.HTTPNotFound(msg)"},{"line_number":241,"context_line":"    return inner"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2F6JU%3D","line":238,"updated":"2013-06-06 08:40:29.000000000","message":"Is there a reason to catch NotFound rather than the more specific SecurityGroupNotFound exception?","commit_id":"4fb80bff2a50c757096cd39500e534b471ae6e37"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cc85fdccd22daf4b4159b7211bf8de0117bf917d","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        except exception.Invalid as exp:"},{"line_number":236,"context_line":"            msg \u003d exp.format_message()"},{"line_number":237,"context_line":"            raise exc.HTTPBadRequest(msg)"},{"line_number":238,"context_line":"        except exception.NotFound as exp:"},{"line_number":239,"context_line":"            msg \u003d exp.format_message()"},{"line_number":240,"context_line":"            raise exc.HTTPNotFound(msg)"},{"line_number":241,"context_line":"    return inner"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPX%2F%2F45A%3D","line":238,"in_reply_to":"AAAAPX%2F%2F6JU%3D","updated":"2013-06-06 17:30:11.000000000","message":"No, my mistake, thanks for catching.","commit_id":"4fb80bff2a50c757096cd39500e534b471ae6e37"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"faa169dfea70a16b12dceb3152c2e7ae184783c3","unresolved":false,"context_lines":[{"line_number":192,"context_line":"    except exception.InstanceNotFound as exp:"},{"line_number":193,"context_line":"        msg \u003d exp.format_message()"},{"line_number":194,"context_line":"        raise exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class SecurityGroupControllerBase(object):"},{"line_number":198,"context_line":"    \"\"\"Base class for Security Group controllers.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPX%2F%2Fx%2Bg%3D","line":195,"updated":"2013-06-10 20:08:41.000000000","message":"Should there be a catch-all here in case someone starts throwing a new Nova exception?  Seems like we don\u0027t want to let those out of this function.  If that does happen it might be worth logging, at least.","commit_id":"8d6eecd7cc2af6a6cb3ce7275c9d2222c677380d"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"dc0f47a28153615de9a0bb3d7ec164f094b0a564","unresolved":false,"context_lines":[{"line_number":192,"context_line":"    except exception.InstanceNotFound as exp:"},{"line_number":193,"context_line":"        msg \u003d exp.format_message()"},{"line_number":194,"context_line":"        raise exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"class SecurityGroupControllerBase(object):"},{"line_number":198,"context_line":"    \"\"\"Base class for Security Group controllers.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPX%2F%2Fvzg%3D","line":195,"in_reply_to":"AAAAPX%2F%2Fx%2Bg%3D","updated":"2013-06-11 14:13:05.000000000","message":"The wsgi framework already catches untranslated Nova exceptions and translates them to HTTP status codes. When this happens it LOGS a backtrace. \n\nIn v3 we will be more explicit an be able to declare what status codes we expect to come out of each method and LOG and return a 500 if unexpected ones occur.","commit_id":"8d6eecd7cc2af6a6cb3ce7275c9d2222c677380d"}],"nova/compute/api.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"643012315d65343313c343db97651eb7a5b313a6","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                # NOTE(melwitt): SecurityGroupAPI semantics are to raise"},{"line_number":359,"context_line":"                # HTTPNotFound for not found and some drivers do this"},{"line_number":360,"context_line":"                # Map to nova exception if it\u0027s raised during a server create"},{"line_number":361,"context_line":"                raise exception.SecurityGroupNotFound("},{"line_number":362,"context_line":"                    security_group_id\u003dsecgroup)"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _check_requested_networks(self, context, requested_networks):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fl8E%3D","line":361,"updated":"2013-05-29 18:46:56.000000000","message":"Should we be raising the same exception as line 354 instead?","commit_id":"6aaddd74ded4b51bc1cdc5dec3c518adc98a4c73"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6a227eec08afa267d29a64600471d90ce51ace49","unresolved":false,"context_lines":[{"line_number":358,"context_line":"                # NOTE(melwitt): SecurityGroupAPI semantics are to raise"},{"line_number":359,"context_line":"                # HTTPNotFound for not found and some drivers do this"},{"line_number":360,"context_line":"                # Map to nova exception if it\u0027s raised during a server create"},{"line_number":361,"context_line":"                raise exception.SecurityGroupNotFound("},{"line_number":362,"context_line":"                    security_group_id\u003dsecgroup)"},{"line_number":363,"context_line":""},{"line_number":364,"context_line":"    def _check_requested_networks(self, context, requested_networks):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fl0Y%3D","line":361,"in_reply_to":"AAAAPH%2F%2Fl8E%3D","updated":"2013-05-29 19:38:14.000000000","message":"Yes, I think you\u0027re right. Thanks for catching that.","commit_id":"6aaddd74ded4b51bc1cdc5dec3c518adc98a4c73"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"65c0692756e7a140999d45e9d96fe6d33871fd31","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                continue"},{"line_number":352,"context_line":"            try:"},{"line_number":353,"context_line":"                if not self.security_group_api.get(context, secgroup):"},{"line_number":354,"context_line":"                    raise exception.SecurityGroupNotFoundForProject("},{"line_number":355,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":356,"context_line":"                        security_group_id\u003dsecgroup)"},{"line_number":357,"context_line":"            except exc.HTTPNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Flwo%3D","line":354,"updated":"2013-05-29 20:26:13.000000000","message":"Now I\u0027m wondering if this should throw an HTTPNotFound and let the exception handler throw the real exception.  It\u0027s a layer of indirection, but it gets rid of the duplication.","commit_id":"8acd9ec377966d7db95df6e1cd7af26845c24737"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0c1c51e5d767f435f9eb569aa312c0f4704e15f9","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                continue"},{"line_number":352,"context_line":"            try:"},{"line_number":353,"context_line":"                if not self.security_group_api.get(context, secgroup):"},{"line_number":354,"context_line":"                    raise exception.SecurityGroupNotFoundForProject("},{"line_number":355,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":356,"context_line":"                        security_group_id\u003dsecgroup)"},{"line_number":357,"context_line":"            except exc.HTTPNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Flks%3D","line":354,"in_reply_to":"AAAAPH%2F%2Flrg%3D","updated":"2013-05-29 21:25:51.000000000","message":"Yeah, but that\u0027s an external API construct and you\u0027re making this change in nova-compute.","commit_id":"8acd9ec377966d7db95df6e1cd7af26845c24737"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c88ae3a0d74033be7ed9c9d7362dd5f35625b225","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                continue"},{"line_number":352,"context_line":"            try:"},{"line_number":353,"context_line":"                if not self.security_group_api.get(context, secgroup):"},{"line_number":354,"context_line":"                    raise exception.SecurityGroupNotFoundForProject("},{"line_number":355,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":356,"context_line":"                        security_group_id\u003dsecgroup)"},{"line_number":357,"context_line":"            except exc.HTTPNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Flrg%3D","line":354,"in_reply_to":"AAAAPH%2F%2Flvk%3D","updated":"2013-05-29 21:17:26.000000000","message":"I had similar concerns and spent some time looking to find the right way to handle this.\n\nThe security_group_api raises HTTPNotFound as part of its native exceptions:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/contrib/security_groups.py#L634\nhttps://github.com/openstack/nova/blob/master/nova/network/security_group/openstack_driver.py#L33\n\nAll of the security group api tests are based around this, raising HTTPNotFound for not found. I think this is because the api is treated as standalone, if you call it directly with a get for a security group, if it\u0027s not found, it would raise HTTPNotFound.\n\nSo I thought if nova is calling the security group api as part of a compound request (create server), it could handle the native exception from it and raise its own exception that servers.py later catches and raises HTTPBadRequest for the server create.","commit_id":"8acd9ec377966d7db95df6e1cd7af26845c24737"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3a845270f9e1589658d86da1dac468bda96b008f","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                continue"},{"line_number":352,"context_line":"            try:"},{"line_number":353,"context_line":"                if not self.security_group_api.get(context, secgroup):"},{"line_number":354,"context_line":"                    raise exception.SecurityGroupNotFoundForProject("},{"line_number":355,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":356,"context_line":"                        security_group_id\u003dsecgroup)"},{"line_number":357,"context_line":"            except exc.HTTPNotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Flvk%3D","line":354,"in_reply_to":"AAAAPH%2F%2Flwo%3D","updated":"2013-05-29 20:31:50.000000000","message":"Actually, I think that the security_group_api should catch the HTTPNotFound and raise SecurityGroupNotFoundForProject. The fact that this call is making an HTTP call in one case and a direct python one in another should be of no concern to the code in this file, IMHO.","commit_id":"8acd9ec377966d7db95df6e1cd7af26845c24737"}]}
