)]}'
{"novaclient/utils.py":[{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b87e1c70c4ce52adc1460b7533985dbb5ba0220c","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        pass"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    # for str id which is not uuid (for Flavor search currently)"},{"line_number":196,"context_line":"    if \u0027flavor\u0027 in manager.resource_class.__name__.lower():"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            return manager.get(name_or_id)"},{"line_number":199,"context_line":"        except exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2F%2Faw%3D","line":196,"updated":"2012-12-17 16:29:32.000000000","message":"Not sure I understand why you use this complex a test.  Why not just compare to, say, \u0027FlavorManager\u0027 or even compare against the FlavorManager class itself?","commit_id":"13070a2fd7adfe2126fbd07faf138d3af09917e0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"b7f4105911f45bf657fada67b31f8cc24bb42972","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        pass"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    # for str id which is not uuid (for Flavor search currently)"},{"line_number":196,"context_line":"    if \u0027flavor\u0027 in manager.resource_class.__name__.lower():"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            return manager.get(name_or_id)"},{"line_number":199,"context_line":"        except exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2F98s%3D","line":196,"in_reply_to":"AAAAM3%2F%2F%2Bcs%3D","updated":"2012-12-18 16:05:55.000000000","message":"If we rename FlavorManager in the future, I\u0027m certain there will be a lot more changes than this single one-line change :)  As long as the unit tests exercise both branches of this if, you should be fine.  FTR, I prefer comparing directly to FlavorManager for this case.","commit_id":"13070a2fd7adfe2126fbd07faf138d3af09917e0"},{"author":{"_account_id":6124,"name":"Rohan Kanade","email":"openstack@rohankanade.com","username":"kanaderohan"},"change_message_id":"261c949cdf2429a7d7ff64eda3025f24d5be3167","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        pass"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    # for str id which is not uuid (for Flavor search currently)"},{"line_number":196,"context_line":"    if \u0027flavor\u0027 in manager.resource_class.__name__.lower():"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            return manager.get(name_or_id)"},{"line_number":199,"context_line":"        except exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2F%2Bcs%3D","line":196,"in_reply_to":"AAAAM3%2F%2F%2Faw%3D","updated":"2012-12-18 04:11:50.000000000","message":"I was thinking about the case if the \u0027FlavorManager\u0027 class name might be modified in future. Hence used direct string comparision. But we can compare directly to FlavorManager class too.","commit_id":"13070a2fd7adfe2126fbd07faf138d3af09917e0"},{"author":{"_account_id":679,"name":"Kevin L. Mitchell","email":"klmitch@mit.edu","username":"klmitch"},"change_message_id":"9b4ea0826c5bef28a6afbfa1c087604eab61e3e9","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        pass"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    # for str id which is not uuid (for Flavor search currently)"},{"line_number":196,"context_line":"    if \u0027flavor\u0027 in manager.resource_class.__name__.lower():"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            return manager.get(name_or_id)"},{"line_number":199,"context_line":"        except exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2F8iE%3D","line":196,"in_reply_to":"AAAAM3%2F%2F87o%3D","updated":"2012-12-19 16:05:29.000000000","message":"You are right, it is pretty generic, and if there is another way of handling this logic—maybe a class attribute only available on FlavorManager, or a new general class attribute, defaulting to False, that happens to enable this behavior?—that would, IMO, be better than comparing directly to FlavorManager.  My basic objection is to the string comparison.","commit_id":"13070a2fd7adfe2126fbd07faf138d3af09917e0"},{"author":{"_account_id":6124,"name":"Rohan Kanade","email":"openstack@rohankanade.com","username":"kanaderohan"},"change_message_id":"f50d4882885a02aee30448b87f07fe1c65ed42a9","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        pass"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"    # for str id which is not uuid (for Flavor search currently)"},{"line_number":196,"context_line":"    if \u0027flavor\u0027 in manager.resource_class.__name__.lower():"},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            return manager.get(name_or_id)"},{"line_number":199,"context_line":"        except exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2F87o%3D","line":196,"in_reply_to":"AAAAM3%2F%2F98s%3D","updated":"2012-12-19 04:24:36.000000000","message":"The unit tests in this patch cover both branches of this if. Also this method \u0027find_resource\u0027 and utils.py seem pretty generic, so my opinion is that we should not import v1_1.flavor.FlavorManager.","commit_id":"13070a2fd7adfe2126fbd07faf138d3af09917e0"}]}
