)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"372cb3bbb55cd754df4b05c897a1f4a3ff838167","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The problem here was when we do reservation after creating group,"},{"line_number":10,"context_line":"synchronization during quota_reserve() gets in_use value as 1 as"},{"line_number":11,"context_line":"the group has already been created befre reserving \u0026 quota commit"},{"line_number":12,"context_line":"updates groups in_use value as +1, hence making 2 for the first"},{"line_number":13,"context_line":"time. So, reservations have been made before creating groups."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7f287b81_2fbed6d4","line":11,"range":{"start_line":11,"start_character":35,"end_line":11,"end_character":40},"updated":"2017-08-28 02:04:26.000000000","message":"before","commit_id":"7131ebe6396e0939fd157b100e65c66ff1ce2b15"}],"cinder/group/api.py":[{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"372cb3bbb55cd754df4b05c897a1f4a3ff838167","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                      \u0027group_id\u0027: group.id}"},{"line_number":186,"context_line":"        group_filter_properties \u003d {}"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        # Update quota for groups"},{"line_number":189,"context_line":"        if reservations:"},{"line_number":190,"context_line":"            GROUP_QUOTAS.commit(context, reservations)"},{"line_number":191,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_8fcf0a55","line":188,"range":{"start_line":188,"start_character":8,"end_line":188,"end_character":33},"updated":"2017-08-28 02:04:26.000000000","message":"Commit group reservations.","commit_id":"7131ebe6396e0939fd157b100e65c66ff1ce2b15"},{"author":{"_account_id":23083,"name":"TommyLike","email":"tommylikehu@gmail.com","username":"TommyLike"},"change_message_id":"372cb3bbb55cd754df4b05c897a1f4a3ff838167","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                          \" %(group)s from group_snapshot %(grp_snap)s.\","},{"line_number":260,"context_line":"                          {\u0027group\u0027: name, \u0027grp_snap\u0027: group_snapshot_id})"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        # Update quota for groups"},{"line_number":263,"context_line":"        if reservations:"},{"line_number":264,"context_line":"            GROUP_QUOTAS.commit(context, reservations)"},{"line_number":265,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f287b81_2fdff60d","line":262,"range":{"start_line":262,"start_character":10,"end_line":262,"end_character":33},"updated":"2017-08-28 02:04:26.000000000","message":"Commit group reservations.","commit_id":"7131ebe6396e0939fd157b100e65c66ff1ce2b15"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                  \u0027volume_type_ids\u0027: [t[\u0027id\u0027] for t in req_volume_types],"},{"line_number":154,"context_line":"                  \u0027group_type_id\u0027: req_group_type[\u0027id\u0027],"},{"line_number":155,"context_line":"                  \u0027replication_status\u0027: c_fields.ReplicationStatus.DISABLED}"},{"line_number":156,"context_line":"        reserve_opts \u003d {\u0027groups\u0027: 1}"},{"line_number":157,"context_line":"        reservations \u003d None"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            reservations \u003d GROUP_QUOTAS.reserve(context,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_156e88c8","line":156,"updated":"2017-08-28 10:10:20.000000000","message":"-1: Creating this dictionary is not necessary, it makes it harder to read and makes us believe the variable is going to be used somewhere else.  Just replace `**reserve_opts` on L 161 with `groups\u003d1`","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":154,"context_line":"                  \u0027group_type_id\u0027: req_group_type[\u0027id\u0027],"},{"line_number":155,"context_line":"                  \u0027replication_status\u0027: c_fields.ReplicationStatus.DISABLED}"},{"line_number":156,"context_line":"        reserve_opts \u003d {\u0027groups\u0027: 1}"},{"line_number":157,"context_line":"        reservations \u003d None"},{"line_number":158,"context_line":"        try:"},{"line_number":159,"context_line":"            reservations \u003d GROUP_QUOTAS.reserve(context,"},{"line_number":160,"context_line":"                                                project_id\u003dcontext.project_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_4608e490","line":157,"updated":"2017-08-28 10:10:20.000000000","message":"-1: This is unnecessary as we\u0027ll always raise an exception on L163, right?","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":168,"context_line":"            group.create()"},{"line_number":169,"context_line":"        except Exception:"},{"line_number":170,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":171,"context_line":"                GROUP_QUOTAS.rollback(context, reservations)"},{"line_number":172,"context_line":"                LOG.error(\"Error occurred when creating group\""},{"line_number":173,"context_line":"                          \" %s.\", name)"},{"line_number":174,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_a620a849","line":171,"updated":"2017-08-28 10:10:20.000000000","message":"-1: Log before rollback","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":186,"context_line":"        group_filter_properties \u003d {}"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        # Commit group reservations"},{"line_number":189,"context_line":"        if reservations:"},{"line_number":190,"context_line":"            GROUP_QUOTAS.commit(context, reservations)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        self._cast_create_group(context, group,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_f5a77c0a","line":189,"updated":"2017-08-28 10:10:20.000000000","message":"?: Why is there an if?  afaik we should always have reservations, right?","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":187,"context_line":""},{"line_number":188,"context_line":"        # Commit group reservations"},{"line_number":189,"context_line":"        if reservations:"},{"line_number":190,"context_line":"            GROUP_QUOTAS.commit(context, reservations)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        self._cast_create_group(context, group,"},{"line_number":193,"context_line":"                                group_spec,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_8675ac34","line":190,"updated":"2017-08-28 10:10:20.000000000","message":"-1: If this fail we should destroy the group from the DB like we are doing now.","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            \u0027volume_type_ids\u0027: volume_type_ids,"},{"line_number":227,"context_line":"            \u0027replication_status\u0027: c_fields.ReplicationStatus.DISABLED"},{"line_number":228,"context_line":"        }"},{"line_number":229,"context_line":"        reserve_opts \u003d {\u0027groups\u0027: 1}"},{"line_number":230,"context_line":"        reservations \u003d None"},{"line_number":231,"context_line":"        try:"},{"line_number":232,"context_line":"            reservations \u003d GROUP_QUOTAS.reserve(context,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_06b09cdc","line":229,"updated":"2017-08-28 10:10:20.000000000","message":"same as above","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":227,"context_line":"            \u0027replication_status\u0027: c_fields.ReplicationStatus.DISABLED"},{"line_number":228,"context_line":"        }"},{"line_number":229,"context_line":"        reserve_opts \u003d {\u0027groups\u0027: 1}"},{"line_number":230,"context_line":"        reservations \u003d None"},{"line_number":231,"context_line":"        try:"},{"line_number":232,"context_line":"            reservations \u003d GROUP_QUOTAS.reserve(context,"},{"line_number":233,"context_line":"                                                project_id\u003dcontext.project_id,"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_e602306f","line":230,"updated":"2017-08-28 10:10:20.000000000","message":"same as above","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                         source_group_id\u003dsource_group_id)"},{"line_number":243,"context_line":"        except exception.GroupNotFound:"},{"line_number":244,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":245,"context_line":"                GROUP_QUOTAS.rollback(context, reservations)"},{"line_number":246,"context_line":"                LOG.error(\"Source Group %(source_group)s not found when \""},{"line_number":247,"context_line":"                          \"creating group %(group)s from source.\","},{"line_number":248,"context_line":"                          {\u0027group\u0027: name, \u0027source_group\u0027: source_group_id})"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_e62a302a","line":245,"updated":"2017-08-28 10:10:20.000000000","message":"-1: We should log the error before trying to rollback the quotas","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                          {\u0027group\u0027: name, \u0027source_group\u0027: source_group_id})"},{"line_number":249,"context_line":"        except exception.GroupSnapshotNotFound:"},{"line_number":250,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":251,"context_line":"                GROUP_QUOTAS.rollback(context, reservations)"},{"line_number":252,"context_line":"                LOG.error(\"Group snapshot %(group_snap)s not found when \""},{"line_number":253,"context_line":"                          \"creating group %(group)s from source.\","},{"line_number":254,"context_line":"                          {\u0027group\u0027: name, \u0027group_snap\u0027: group_snapshot_id})"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_661640f4","line":251,"updated":"2017-08-28 10:10:20.000000000","message":"ditto","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                          {\u0027group\u0027: name, \u0027group_snap\u0027: group_snapshot_id})"},{"line_number":255,"context_line":"        except Exception:"},{"line_number":256,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":257,"context_line":"                GROUP_QUOTAS.rollback(context, reservations)"},{"line_number":258,"context_line":"                LOG.error(\"Error occurred when creating group\""},{"line_number":259,"context_line":"                          \" %(group)s from group_snapshot %(grp_snap)s.\","},{"line_number":260,"context_line":"                          {\u0027group\u0027: name, \u0027grp_snap\u0027: group_snapshot_id})"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_46d5841b","line":257,"updated":"2017-08-28 10:10:20.000000000","message":"ditto","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"bc02c3bd4185d55347eb768de6821beb0587a4a3","unresolved":false,"context_lines":[{"line_number":260,"context_line":"                          {\u0027group\u0027: name, \u0027grp_snap\u0027: group_snapshot_id})"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"        # Commit group reservations"},{"line_number":263,"context_line":"        if reservations:"},{"line_number":264,"context_line":"            GROUP_QUOTAS.commit(context, reservations)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        if not group.host:"}],"source_content_type":"text/x-python","patch_set":7,"id":"7f287b81_c6e854e3","line":263,"updated":"2017-08-28 10:10:20.000000000","message":"?: Why are we checking this? afaik we should always have reservations, right?","commit_id":"39e2260ba811badd50f0bd6a48b1d44050410e5a"}],"cinder/tests/unit/api/contrib/test_consistencygroups.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9f5e4b2fc3fb866f92118f7e2dbfa8ad6be3dc8b","unresolved":false,"context_lines":[{"line_number":602,"context_line":"        self.mock_object(db, \u0027volume_types_get_by_name_or_id\u0027,"},{"line_number":603,"context_line":"                         return_value\u003d[fake_vol_type])"},{"line_number":604,"context_line":"        self.mock_object(self.cg_api, \u0027_cast_create_group\u0027)"},{"line_number":605,"context_line":"        quota.GROUP_QUOTAS.reserve \u003d mock.MagicMock(return_value\u003d"},{"line_number":606,"context_line":"                                                    \u0027reservations\u0027)"},{"line_number":607,"context_line":"        quota.GROUP_QUOTAS.commit \u003d mock.MagicMock()"},{"line_number":608,"context_line":"        self.mock_object(self.cg_api, \u0027update_quota\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_f7eabdd5","line":605,"updated":"2017-08-29 11:40:15.000000000","message":"-1: Don\u0027t replace a method directly, use mock.patch or mock.patch.object","commit_id":"4c3babc86b61e53e14e9ed8894deebb13c367642"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fa477be61e00a17fe68e0dc3fc421c83318c037a","unresolved":false,"context_lines":[{"line_number":593,"context_line":"        self.assertIsNone(cg.host)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"    @mock.patch(\u0027quota.GROUP_QUOTAS.reserve\u0027, return_value\u003d\u0027reservations\u0027)"},{"line_number":596,"context_line":"    @mock.patch(\u0027quota.GROUP_QUOTAS.commit\u0027)"},{"line_number":597,"context_line":"    def test_create_delete_consistencygroup_update_quota(self, mock_commit,"},{"line_number":598,"context_line":"                                                         mock_reserve):"},{"line_number":599,"context_line":"        name \u003d \u0027mycg\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f287b81_2b3a1ccb","line":596,"updated":"2017-08-29 13:58:16.000000000","message":"-1: This will not work, you need to do full path \u0027cinder.quota.GROUP...\u0027 or use mock.patch(quota, \u0027GROUP...\u0027","commit_id":"fcaf0cb17f0d9a4871e8ec414497fb57927418e1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7e0f2d6542a7b9fed59be77cbbfb67ef2a8aa341","unresolved":false,"context_lines":[{"line_number":30,"context_line":"from cinder.i18n import _"},{"line_number":31,"context_line":"from cinder import objects"},{"line_number":32,"context_line":"from cinder.objects import fields"},{"line_number":33,"context_line":"from cinder import quota"},{"line_number":34,"context_line":"from cinder import test"},{"line_number":35,"context_line":"from cinder.tests.unit.api import fakes"},{"line_number":36,"context_line":"from cinder.tests.unit.api.v2 import fakes as v2_fakes"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f287b81_56ed0cb5","line":33,"updated":"2017-08-29 16:18:52.000000000","message":"-1: you need to remove this import that is no longer used","commit_id":"012d8a105f52c8563425508d027853fcc68f3479"}],"cinder/tests/unit/api/v3/test_groups.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"9f5e4b2fc3fb866f92118f7e2dbfa8ad6be3dc8b","unresolved":false,"context_lines":[{"line_number":587,"context_line":"                         return_value\u003d[fake_type])"},{"line_number":588,"context_line":"        self.mock_object(db, \u0027group_type_get\u0027, return_value\u003dgrp_type)"},{"line_number":589,"context_line":"        self.mock_object(self.group_api, \u0027_cast_create_group\u0027)"},{"line_number":590,"context_line":"        quota.GROUP_QUOTAS.reserve \u003d mock.MagicMock(return_value\u003d"},{"line_number":591,"context_line":"                                                    \u0027reservations\u0027)"},{"line_number":592,"context_line":"        quota.GROUP_QUOTAS.commit \u003d mock.MagicMock()"},{"line_number":593,"context_line":"        self.mock_object(self.group_api, \u0027update_quota\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7f287b81_d7a221ae","line":590,"updated":"2017-08-29 11:40:15.000000000","message":"-1: Don\u0027t replace a method directly, use mock.patch or mock.patch.object","commit_id":"4c3babc86b61e53e14e9ed8894deebb13c367642"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"fa477be61e00a17fe68e0dc3fc421c83318c037a","unresolved":false,"context_lines":[{"line_number":579,"context_line":"        self.assertIsNone(group.host)"},{"line_number":580,"context_line":""},{"line_number":581,"context_line":"    @mock.patch(\u0027quota.GROUP_QUOTAS.reserve\u0027, return_value\u003d\u0027reservations\u0027)"},{"line_number":582,"context_line":"    @mock.patch(\u0027quota.GROUP_QUOTAS.commit\u0027)"},{"line_number":583,"context_line":"    def test_create_delete_group_update_quota(self, mock_commit, mock_reserve):"},{"line_number":584,"context_line":"        name \u003d \u0027mygroup\u0027"},{"line_number":585,"context_line":"        description \u003d \u0027group 1\u0027"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f287b81_0b33e0f7","line":582,"updated":"2017-08-29 13:58:16.000000000","message":"ditto","commit_id":"fcaf0cb17f0d9a4871e8ec414497fb57927418e1"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"7e0f2d6542a7b9fed59be77cbbfb67ef2a8aa341","unresolved":false,"context_lines":[{"line_number":29,"context_line":"import cinder.group"},{"line_number":30,"context_line":"from cinder import objects"},{"line_number":31,"context_line":"from cinder.objects import fields"},{"line_number":32,"context_line":"from cinder import quota"},{"line_number":33,"context_line":"from cinder import test"},{"line_number":34,"context_line":"from cinder.tests.unit.api import fakes"},{"line_number":35,"context_line":"from cinder.tests.unit.api.v3 import fakes as v3_fakes"}],"source_content_type":"text/x-python","patch_set":11,"id":"7f287b81_1631c45a","line":32,"updated":"2017-08-29 16:18:52.000000000","message":"ditto","commit_id":"012d8a105f52c8563425508d027853fcc68f3479"}]}
