)]}'
{"nova/objects/resource_provider.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"9404987f3b4af6e3156b662789b982f3fdd7f9a2","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"            # NOTE(jaypipes): The resource class cache will look up the"},{"line_number":1051,"context_line":"            # resource class in the DB if not found in the standard resource"},{"line_number":1052,"context_line":"            # classes, so if we got here, we know no such resource class exists"},{"line_number":1053,"context_line":"            raise exception.NotFound()"},{"line_number":1054,"context_line":""},{"line_number":1055,"context_line":"    @staticmethod"},{"line_number":1056,"context_line":"    @db_api.api_context_manager.reader"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5da102_df0496c1","line":1053,"updated":"2016-11-01 10:47:00.000000000","message":"Not sure if it is relevant here, but we\u0027ve recently had a spate of \"adding messages to bare NotFound exceptions in resource_provider.py\" changes. In this context are we assuming that the caller will have sufficient info to make a reasonably meaningful error?","commit_id":"fcd6cbae87f1088aee35d9dc2e2a0e0f460df494"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e87357da66ccbc5448e8fde9e78b7b088285c558","unresolved":false,"context_lines":[{"line_number":1050,"context_line":"            # NOTE(jaypipes): The resource class cache will look up the"},{"line_number":1051,"context_line":"            # resource class in the DB if not found in the standard resource"},{"line_number":1052,"context_line":"            # classes, so if we got here, we know no such resource class exists"},{"line_number":1053,"context_line":"            raise exception.NotFound()"},{"line_number":1054,"context_line":""},{"line_number":1055,"context_line":"    @staticmethod"},{"line_number":1056,"context_line":"    @db_api.api_context_manager.reader"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5da102_082df7fd","line":1053,"in_reply_to":"ba5da102_df0496c1","updated":"2016-11-01 11:51:15.000000000","message":"Yeah, I think since there\u0027s only a single argument to the method (name) that the caller can figure out that there\u0027s no resource class that matches that name.","commit_id":"fcd6cbae87f1088aee35d9dc2e2a0e0f460df494"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efd8f05f9e5234724cb54ab906f20ae66e9a57a","unresolved":false,"context_lines":[{"line_number":1076,"context_line":"        try:"},{"line_number":1077,"context_line":"            rc_id \u003d _RC_CACHE.id_from_string(name)"},{"line_number":1078,"context_line":"            return cls(context, id\u003drc_id, name\u003dname)"},{"line_number":1079,"context_line":"        except KeyError:"},{"line_number":1080,"context_line":"            # NOTE(jaypipes): The resource class cache will look up the"},{"line_number":1081,"context_line":"            # resource class in the DB if not found in the standard resource"},{"line_number":1082,"context_line":"            # classes, so if we got here, we know no such resource class exists"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_c5665d50","line":1079,"updated":"2016-11-17 18:46:13.000000000","message":"This is ResourceClassNotFound now, not KeyError. And ResourceClassNotFound extends NotFound, so it seems you should just let this ride up the stack.","commit_id":"f3dbee39a1ab8ea4f7dc668602f4fce93b058723"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ac36abc286afd883ff36e6a2d90f2aeeaf1e8b16","unresolved":false,"context_lines":[{"line_number":1076,"context_line":"        try:"},{"line_number":1077,"context_line":"            rc_id \u003d _RC_CACHE.id_from_string(name)"},{"line_number":1078,"context_line":"            return cls(context, id\u003drc_id, name\u003dname)"},{"line_number":1079,"context_line":"        except KeyError:"},{"line_number":1080,"context_line":"            # NOTE(jaypipes): The resource class cache will look up the"},{"line_number":1081,"context_line":"            # resource class in the DB if not found in the standard resource"},{"line_number":1082,"context_line":"            # classes, so if we got here, we know no such resource class exists"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_bac3d037","line":1079,"in_reply_to":"7a77a97e_c5665d50","updated":"2016-11-21 17:30:54.000000000","message":"Done","commit_id":"f3dbee39a1ab8ea4f7dc668602f4fce93b058723"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4dd33167883bb2039d09ee3c212348a74be0f1c7","unresolved":false,"context_lines":[{"line_number":1074,"context_line":"    def get_by_name(cls, context, name):"},{"line_number":1075,"context_line":"        \"\"\"Return a ResourceClass object with the given string name."},{"line_number":1076,"context_line":""},{"line_number":1077,"context_line":"        :param name: String name of the resource class to find"},{"line_number":1078,"context_line":""},{"line_number":1079,"context_line":"        :raises: ResourceClassNotFound if no such resource class was found"},{"line_number":1080,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":12,"id":"7a77a97e_ba3bc237","line":1077,"updated":"2016-11-22 00:49:37.000000000","message":"nit: if you\u0027re going to call out parameters, add context to be complete.","commit_id":"91f350f63b1a4852c17539c2388d78cfc484b507"}],"nova/tests/functional/db/test_resource_provider.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6efd8f05f9e5234724cb54ab906f20ae66e9a57a","unresolved":false,"context_lines":[{"line_number":1031,"context_line":"        self.assertEqual(fields.ResourceClass.VCPU, rc.name)"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_get_by_name_not_found(self):"},{"line_number":1034,"context_line":"        self.assertRaises(exception.ResourceClassNotFound,"},{"line_number":1035,"context_line":"                          objects.ResourceClass.get_by_name,"},{"line_number":1036,"context_line":"                          self.context,"},{"line_number":1037,"context_line":"                          \u0027CUSTOM_NO_EXISTS\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"7a77a97e_c5cd7d32","line":1034,"updated":"2016-11-17 18:46:13.000000000","message":"See, this should actually be NotFound if you handled the KeyError.","commit_id":"f3dbee39a1ab8ea4f7dc668602f4fce93b058723"}]}
