)]}'
{"glance/api/v2/image_data.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"858c2c02e77c642434d219d7395121f1fd3094e6","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        try:"},{"line_number":56,"context_line":"            location, size, checksum \u003d self.store_api.add_to_backend("},{"line_number":57,"context_line":"                    req.context, \u0027file\u0027, image_id, data, size)"},{"line_number":58,"context_line":"            v2.update_image_read_acl(req, self.db_api, image)"},{"line_number":59,"context_line":"            values \u003d {\u0027location\u0027: location, \u0027size\u0027: size, \u0027checksum\u0027: checksum}"},{"line_number":60,"context_line":"            self.db_api.image_update(req.context, image_id, values)"},{"line_number":61,"context_line":"            updated_image \u003d self._get_image(req.context, image_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FpS0%3D","line":58,"updated":"2012-08-23 14:41:43.000000000","message":"Rather than move all of these calls into the try, it would be better form to use an else clause:\n\n  try:\n    location, size ...\n  except exception.Duplicate:\n    self.notifier.error ...\n    raise HTTPConflict ...\n  else:\n    v2.update_image_...\n    self.notifier.info(\u0027image_upload\u0027, ...","commit_id":"1c0fc27f54316daad2246fd8ef2ed059203f6600"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"8fe215471b385a2a42892a96a7b0550e677ba8f3","unresolved":false,"context_lines":[{"line_number":28,"context_line":""},{"line_number":29,"context_line":"class ImageDataController(object):"},{"line_number":30,"context_line":"    def __init__(self, db_api\u003dNone, store_api\u003dNone,"},{"line_number":31,"context_line":"                policy_enforcer\u003dNone, notifier\u003dNone):"},{"line_number":32,"context_line":"        self.db_api \u003d db_api or glance.db.get_api()"},{"line_number":33,"context_line":"        self.db_api.configure_db()"},{"line_number":34,"context_line":"        self.store_api \u003d store_api or glance.store"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FnJA%3D","line":31,"updated":"2012-08-27 17:23:40.000000000","message":"this line needs to be pushed to the right one more space.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"8fe215471b385a2a42892a96a7b0550e677ba8f3","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"class ResponseSerializer(wsgi.JSONResponseSerializer):"},{"line_number":100,"context_line":"    def __init__(self, notifier\u003dNone):"},{"line_number":101,"context_line":"        self.notifier \u003d glance.notifier.Notifier()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def download(self, response, result):"},{"line_number":104,"context_line":"        size \u003d result[\u0027meta\u0027][\u0027size\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FnI4%3D","line":101,"updated":"2012-08-27 17:23:40.000000000","message":"You aren\u0027t using the notifier argument.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"90429b2d8c812c8ac207de40d38b72571dd19a54","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"class ResponseSerializer(wsgi.JSONResponseSerializer):"},{"line_number":100,"context_line":"    def __init__(self, notifier\u003dNone):"},{"line_number":101,"context_line":"        self.notifier \u003d glance.notifier.Notifier()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def download(self, response, result):"},{"line_number":104,"context_line":"        size \u003d result[\u0027meta\u0027][\u0027size\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fm9k%3D","line":101,"in_reply_to":"AAAALH%2F%2Fm%2BY%3D","updated":"2012-08-27 21:54:55.000000000","message":"I should have commented on the line above. The argument in the __init__ is not being used. You need to call this here:\n\n  self.notifier \u003d notifier or glance.notifier.Notifier()","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"950a8eacbdb5eeea4f2f23ec380043d066276723","unresolved":false,"context_lines":[{"line_number":98,"context_line":""},{"line_number":99,"context_line":"class ResponseSerializer(wsgi.JSONResponseSerializer):"},{"line_number":100,"context_line":"    def __init__(self, notifier\u003dNone):"},{"line_number":101,"context_line":"        self.notifier \u003d glance.notifier.Notifier()"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def download(self, response, result):"},{"line_number":104,"context_line":"        size \u003d result[\u0027meta\u0027][\u0027size\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fm%2BY%3D","line":101,"in_reply_to":"AAAALH%2F%2FnI4%3D","updated":"2012-08-27 21:29:57.000000000","message":"I am using it in the download fn line 110.\n\nIt is initialize in init, so i can use FakeNotifier in tests.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9d3b8bba050d0eae22b08a4a8f65cbefa5cfa70c","unresolved":false,"context_lines":[{"line_number":56,"context_line":"            location, size, checksum \u003d self.store_api.add_to_backend("},{"line_number":57,"context_line":"                    req.context, \u0027file\u0027, image_id, data, size)"},{"line_number":58,"context_line":"        except exception.Duplicate:"},{"line_number":59,"context_line":"            msg \u003d _(\"Attempt to upload duplicate image\")"},{"line_number":60,"context_line":"            raise webob.exc.HTTPConflict()"},{"line_number":61,"context_line":"        else:"},{"line_number":62,"context_line":"            v2.update_image_read_acl(req, self.db_api, image)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FlZ8%3D","line":59,"updated":"2012-08-29 16:11:12.000000000","message":"This isn\u0027t being used anywhere.","commit_id":"c5294b6a14c54e8ed6fd385d651f500031589464"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9d3b8bba050d0eae22b08a4a8f65cbefa5cfa70c","unresolved":false,"context_lines":[{"line_number":96,"context_line":""},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"class ResponseSerializer(wsgi.JSONResponseSerializer):"},{"line_number":99,"context_line":"    def __init__(self, notifier\u003dNone):"},{"line_number":100,"context_line":"        self.notifier \u003d notifier or glance.notifier.Notifier()"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"    def download(self, response, result):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAALH%2F%2FlZ4%3D","line":99,"updated":"2012-08-29 16:11:12.000000000","message":"You should always call the superclass constructor unless you have a good reason not to do so:\n\n  super(ResponseSerializer, self).__init__()","commit_id":"c5294b6a14c54e8ed6fd385d651f500031589464"}],"glance/api/v2/images.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"a3dc2ab6a8150f48571e1f4e86081b0dd6530b7f","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            msg \u003d (\"Failed to find image %(image_id)s to update\" % locals())"},{"line_number":158,"context_line":"            LOG.info(msg)"},{"line_number":159,"context_line":"            self.notifier.info(\u0027image.update\u0027, msg)"},{"line_number":160,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        image \u003d self._normalize_properties(dict(image))"},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fo6Y%3D","line":160,"updated":"2012-08-23 20:49:23.000000000","message":"I think this msg is maybe not the right one for the HTTP Error Response body. But its okay for the notification, so maybe we just need different messages for the failure notification and the HTTP response.","commit_id":"afd57f572d232a087720a10a22d432d32331f904"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"a3dc2ab6a8150f48571e1f4e86081b0dd6530b7f","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            msg \u003d (\"Failed to find image %(image_id)s to delete\" % locals())"},{"line_number":190,"context_line":"            LOG.info(msg)"},{"line_number":191,"context_line":"            self.notifier.info(\u0027image.delete\u0027, msg)"},{"line_number":192,"context_line":"            raise webob.exc.HTTPNotFound()"},{"line_number":193,"context_line":"        else:"},{"line_number":194,"context_line":"            self.notifier.info(\u0027image.delete\u0027, image)"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fo6E%3D","line":192,"updated":"2012-08-23 20:49:23.000000000","message":"Or you could leave the HTTPNotFound message empty above as you did here. :-)","commit_id":"afd57f572d232a087720a10a22d432d32331f904"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"8fe215471b385a2a42892a96a7b0550e677ba8f3","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        try:"},{"line_number":155,"context_line":"            image \u003d self.db_api.image_update(req.context, image_id, image)"},{"line_number":156,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":157,"context_line":"            msg \u003d (\"Failed to find image %(image_id)s to update\" % locals())"},{"line_number":158,"context_line":"            LOG.info(msg)"},{"line_number":159,"context_line":"            self.notifier.info(\u0027image.update\u0027, msg)"},{"line_number":160,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FnI0%3D","line":157,"updated":"2012-08-27 17:23:40.000000000","message":"This doesn\u0027t seem like something we need to notify about. No changes have been made.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"950a8eacbdb5eeea4f2f23ec380043d066276723","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        try:"},{"line_number":155,"context_line":"            image \u003d self.db_api.image_update(req.context, image_id, image)"},{"line_number":156,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":157,"context_line":"            msg \u003d (\"Failed to find image %(image_id)s to update\" % locals())"},{"line_number":158,"context_line":"            LOG.info(msg)"},{"line_number":159,"context_line":"            self.notifier.info(\u0027image.update\u0027, msg)"},{"line_number":160,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2Fm%2BU%3D","line":157,"in_reply_to":"AAAALH%2F%2FnI0%3D","updated":"2012-08-27 21:29:57.000000000","message":"v1 sent this notification, so I just replicated the behavior here. So I was unsure if something consumed this notification.\n\nWill remove it.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"8fe215471b385a2a42892a96a7b0550e677ba8f3","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        if image[\u0027protected\u0027]:"},{"line_number":181,"context_line":"            msg \u003d _(\"Unable to delete as image %(image_id)s is protected\""},{"line_number":182,"context_line":"                    % locals())"},{"line_number":183,"context_line":"            self.notifier.info(\u0027image.delete\u0027, msg)"},{"line_number":184,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003dmsg)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FnIo%3D","line":183,"updated":"2012-08-27 17:23:40.000000000","message":"Same thing goes here, I don\u0027t think we need to be sending notifications for failed actions like this.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"8fe215471b385a2a42892a96a7b0550e677ba8f3","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        except (exception.NotFound, exception.Forbidden):"},{"line_number":189,"context_line":"            msg \u003d (\"Failed to find image %(image_id)s to delete\" % locals())"},{"line_number":190,"context_line":"            LOG.info(msg)"},{"line_number":191,"context_line":"            self.notifier.info(\u0027image.delete\u0027, msg)"},{"line_number":192,"context_line":"            raise webob.exc.HTTPNotFound()"},{"line_number":193,"context_line":"        else:"},{"line_number":194,"context_line":"            self.notifier.info(\u0027image.delete\u0027, image)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAALH%2F%2FnIk%3D","line":191,"updated":"2012-08-27 17:23:40.000000000","message":"Same thing goes here, I don\u0027t think we need to be sending notifications for failed actions like this.","commit_id":"776b2e66fff944ae5189aa332567de14717f3af4"}],"glance/tests/unit/utils.py":[{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"a3dc2ab6a8150f48571e1f4e86081b0dd6530b7f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        self.rules \u003d rules"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"class FakeNotifier(object):"},{"line_number":127,"context_line":"    def __init__(self, *_args, **kwargs):"},{"line_number":128,"context_line":"        LOG.debug(_(\"Fake Notifier created\"))"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fo58%3D","line":126,"updated":"2012-08-23 20:49:23.000000000","message":"Could this class save some of the calls that are made on it (kind of like a Mock) so that our tests could check to see if certain notifications were sent?","commit_id":"afd57f572d232a087720a10a22d432d32331f904"},{"author":{"_account_id":4463,"name":"iccha-sethi","email":"iccha.sethi@rackspace.com","username":"iccha-sethi"},"change_message_id":"3b2cafbd7a3b9c7d7ed778a307b958ba4375064d","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                    % locals())"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"    def info(self, event_type, payload):"},{"line_number":135,"context_line":"        LOG.debug(_(\"Fake Notification INFO  %(event_type)s\""},{"line_number":136,"context_line":"                   % locals()))"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def error(self, event_type, payload):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAALH%2F%2Fo54%3D","line":135,"updated":"2012-08-23 20:46:07.000000000","message":"Is there a better way to test this?","commit_id":"afd57f572d232a087720a10a22d432d32331f904"}],"glance/tests/unit/v2/test_image_data_resource.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9a986f3a3cadb0e3baefbc7bcbadc05ca3ab3dc5","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.assertRaises(webob.exc.HTTPNotFound, self.controller.download,"},{"line_number":49,"context_line":"                          request, unit_test_utils.UUID2)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    def test_download_non_existant_image(self):"},{"line_number":52,"context_line":"        request \u003d unit_test_utils.get_fake_request()"},{"line_number":53,"context_line":"        self.assertRaises(webob.exc.HTTPNotFound, self.controller.download,"},{"line_number":54,"context_line":"                          request, utils.generate_uuid())"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FmYU%3D","line":51,"updated":"2012-08-28 15:49:05.000000000","message":"undo this change","commit_id":"f0a532fe87a69d1bd0a71a46bbf329077e5a75c5"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9a986f3a3cadb0e3baefbc7bcbadc05ca3ab3dc5","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        output_log \u003d self.notifier.get_log()"},{"line_number":64,"context_line":"        expected_log \u003d {\u0027notification_type\u0027: \"INFO\","},{"line_number":65,"context_line":"                        \u0027event_type\u0027: \"image.upload\","},{"line_number":66,"context_line":"                        \u0027payload\u0027: output[\u0027meta\u0027], }"},{"line_number":67,"context_line":"        self.assertEqual(output_log, expected_log)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_upload_non_existant_image(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FmX8%3D","line":66,"updated":"2012-08-28 15:49:05.000000000","message":"This is always cleaner as\n\nexpected_log \u003d {\n  \u0027notification_type\u0027: ...,\n}","commit_id":"f0a532fe87a69d1bd0a71a46bbf329077e5a75c5"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9a986f3a3cadb0e3baefbc7bcbadc05ca3ab3dc5","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                        \u0027payload\u0027: output[\u0027meta\u0027], }"},{"line_number":67,"context_line":"        self.assertEqual(output_log, expected_log)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def test_upload_non_existant_image(self):"},{"line_number":70,"context_line":"        request \u003d unit_test_utils.get_fake_request()"},{"line_number":71,"context_line":"        self.assertRaises(webob.exc.HTTPNotFound, self.controller.upload,"},{"line_number":72,"context_line":"                          request, utils.generate_uuid(), \u0027YYYY\u0027, 4)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FmYQ%3D","line":69,"updated":"2012-08-28 15:49:05.000000000","message":"undo this change","commit_id":"f0a532fe87a69d1bd0a71a46bbf329077e5a75c5"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9a986f3a3cadb0e3baefbc7bcbadc05ca3ab3dc5","unresolved":false,"context_lines":[{"line_number":172,"context_line":"    def setUp(self):"},{"line_number":173,"context_line":"        super(TestImageDataSerializer, self).setUp()"},{"line_number":174,"context_line":"        self.serializer \u003d glance.api.v2.image_data.ResponseSerializer("},{"line_number":175,"context_line":"                            notifier\u003dunit_test_utils.FakeNotifier())"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def test_download(self):"},{"line_number":178,"context_line":"        request \u003d webob.Request.blank(\u0027/\u0027)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FmYA%3D","line":175,"updated":"2012-08-28 15:49:05.000000000","message":"This should only be tabbed over twice.","commit_id":"f0a532fe87a69d1bd0a71a46bbf329077e5a75c5"}],"glance/tests/unit/v2/test_images_resource.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"9a986f3a3cadb0e3baefbc7bcbadc05ca3ab3dc5","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        expected \u003d set([UUID1, UUID2, UUID3])"},{"line_number":187,"context_line":"        self.assertEqual(actual, expected)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def test_index_with_nonexistant_name_filter(self):"},{"line_number":190,"context_line":"        request \u003d unit_test_utils.get_fake_request(\u0027/images?name\u003d%s\u0027 % \u0027blah\u0027)"},{"line_number":191,"context_line":"        images \u003d self.controller.index(request,"},{"line_number":192,"context_line":"                                       filters\u003d{\u0027name\u0027: \u0027blah\u0027})[\u0027images\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAALH%2F%2FmX4%3D","line":189,"updated":"2012-08-28 15:49:05.000000000","message":"I think you just had a bad rebase and dropped the patch that changed all these from existant -\u003e existent.","commit_id":"f0a532fe87a69d1bd0a71a46bbf329077e5a75c5"}]}
