)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9214,"name":"Sergio Cazzolato","email":"sergiocazzolato@gmail.com","username":"sjcazzol"},"change_message_id":"5b659bb2ca400915d376b0f5dbfec646b07157fb","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add read_only field attribute"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some field of an object are created by database automatically like"},{"line_number":10,"context_line":"\u0027id\u0027 in service object, thus should not be changed in general."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Add a read_only field attribute to specify such situation, which"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7adec928_6b054979","line":9,"updated":"2014-05-09 22:29:59.000000000","message":"Two typos, in both should be:\n1. Some fields\n2. by the database","commit_id":"d9c44b48e4e2827fa0b194c06067ec0ad299cf73"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"bb615d40f3444ff72656db77d923a23e14d89bff","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add read_only field attribute"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Some field of an object are created by database automatically like"},{"line_number":10,"context_line":"\u0027id\u0027 in service object, thus should not be changed in general."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Add a read_only field attribute to specify such situation, which"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7adec928_0b2125b4","line":9,"in_reply_to":"7adec928_6b054979","updated":"2014-05-20 23:19:11.000000000","message":"Thanks. Done.","commit_id":"d9c44b48e4e2827fa0b194c06067ec0ad299cf73"}],"nova/exception.py":[{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"f13b57847708304533dcf57522097f63520452ce","unresolved":false,"context_lines":[{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"class ReadOnlyFieldError(NovaException):"},{"line_number":1381,"context_line":"    msg_fmt \u003d _(\u0027Try to set field %(field)s again which can be set only once\u0027)"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"class ObjectActionError(NovaException):"}],"source_content_type":"text/x-python","patch_set":3,"id":"facab960_22ff2e03","line":1381,"updated":"2014-04-28 20:39:37.000000000","message":"The error message is not quite clear.  Should it say: _(\u0027Cannot modify readonly field %(field)s\u0027)?","commit_id":"37eedbcacc2990c1e6560f67602929a8f23ade84"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"b63362760e3b23379531b7cc2ab8845f166e74fe","unresolved":false,"context_lines":[{"line_number":1378,"context_line":""},{"line_number":1379,"context_line":""},{"line_number":1380,"context_line":"class ReadOnlyFieldError(NovaException):"},{"line_number":1381,"context_line":"    msg_fmt \u003d _(\u0027Try to set field %(field)s again which can be set only once\u0027)"},{"line_number":1382,"context_line":""},{"line_number":1383,"context_line":""},{"line_number":1384,"context_line":"class ObjectActionError(NovaException):"}],"source_content_type":"text/x-python","patch_set":3,"id":"bad4c104_073ea6b8","line":1381,"in_reply_to":"facab960_22ff2e03","updated":"2014-05-02 18:30:32.000000000","message":"Hmm, yes, I should change this to match the filed attribute. Thanks.","commit_id":"37eedbcacc2990c1e6560f67602929a8f23ade84"}],"nova/objects/base.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"db540f40abd551607723881a4645a84eac94f0e6","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            attrname \u003d get_attrname(name)"},{"line_number":72,"context_line":"            field_value \u003d field.coerce(self, name, value)"},{"line_number":73,"context_line":"            if (field._read_only and hasattr(self, attrname) and"},{"line_number":74,"context_line":"                    getattr(self, attrname) !\u003d field_value):"},{"line_number":75,"context_line":"                raise exception.ReadOnlyFieldError(field\u003dname)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad9bd40_cf71ae45","line":74,"updated":"2014-05-06 14:14:27.000000000","message":"I don\u0027t think you want to do the getattr() check here. I think you\u0027re doing it because you want to avoid a failure if you re-set it to the same value, but in that case, it will end up in changed_fields, which we don\u0027t want.\n\nI think you should just check to see if it\u0027s write-once, and already set, and if so bail. And, do that before you run self._changed_fields.add()","commit_id":"408023eaa1e91845264424b27a650a399c672100"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"b9284a07ae26f5670c25d356af1569df8808f00e","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            attrname \u003d get_attrname(name)"},{"line_number":72,"context_line":"            field_value \u003d field.coerce(self, name, value)"},{"line_number":73,"context_line":"            if (field._read_only and hasattr(self, attrname) and"},{"line_number":74,"context_line":"                    getattr(self, attrname) !\u003d field_value):"},{"line_number":75,"context_line":"                raise exception.ReadOnlyFieldError(field\u003dname)"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad9bd40_e06bdc1b","line":74,"in_reply_to":"9ad9bd40_cf71ae45","updated":"2014-05-06 18:52:56.000000000","message":"Thanks for the suggestion.","commit_id":"408023eaa1e91845264424b27a650a399c672100"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"448db72dca3b26d9761c3e55e42548c8e792be51","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        def setter(self, value, name\u003dname, field\u003dfield):"},{"line_number":70,"context_line":"            attrname \u003d get_attrname(name)"},{"line_number":71,"context_line":"            if field.read_only and hasattr(self, attrname):"},{"line_number":72,"context_line":"                return"},{"line_number":73,"context_line":"            self._changed_fields.add(name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_96a00445","line":72,"updated":"2014-05-09 16:53:23.000000000","message":"I think raising the exception here is good, right? Otherwise it will silently ignore something and nobody will know until data isn\u0027t saved and they might not know why.","commit_id":"4a04b762ce5fa1dc4dbb71496018ca06c56a5421"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"f7eb8836e7c3bacdd72b3e53cc5368c2eb7a0cff","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        def setter(self, value, name\u003dname, field\u003dfield):"},{"line_number":70,"context_line":"            attrname \u003d get_attrname(name)"},{"line_number":71,"context_line":"            if field.read_only and hasattr(self, attrname):"},{"line_number":72,"context_line":"                return"},{"line_number":73,"context_line":"            self._changed_fields.add(name)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7adec928_bc0de139","line":72,"in_reply_to":"7adec928_96a00445","updated":"2014-05-09 17:47:32.000000000","message":"Done","commit_id":"4a04b762ce5fa1dc4dbb71496018ca06c56a5421"}],"nova/objects/fields.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"db540f40abd551607723881a4645a84eac94f0e6","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        self._type \u003d field_type"},{"line_number":123,"context_line":"        self._nullable \u003d nullable"},{"line_number":124,"context_line":"        self._default \u003d default"},{"line_number":125,"context_line":"        self._read_only \u003d read_only"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @property"},{"line_number":128,"context_line":"    def nullable(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad9bd40_2f985a69","line":125,"updated":"2014-05-06 14:14:27.000000000","message":"Can you add a property for this like the others and use it in the wrapper in base? I don\u0027t like the \"field._read_only\" syntax.","commit_id":"408023eaa1e91845264424b27a650a399c672100"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"b9284a07ae26f5670c25d356af1569df8808f00e","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        self._type \u003d field_type"},{"line_number":123,"context_line":"        self._nullable \u003d nullable"},{"line_number":124,"context_line":"        self._default \u003d default"},{"line_number":125,"context_line":"        self._read_only \u003d read_only"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    @property"},{"line_number":128,"context_line":"    def nullable(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9ad9bd40_5aa2b5fd","line":125,"in_reply_to":"9ad9bd40_2f985a69","updated":"2014-05-06 18:52:56.000000000","message":"Done.","commit_id":"408023eaa1e91845264424b27a650a399c672100"}],"nova/tests/api/openstack/compute/contrib/test_services.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"45cb6152d7d4d3a3685c44b8ce984ab828091717","unresolved":false,"context_lines":[{"line_number":382,"context_line":"    def test_services_enable(self):"},{"line_number":383,"context_line":"        def _service_update(context, service_id, values):"},{"line_number":384,"context_line":"            self.assertIsNone(values[\u0027disabled_reason\u0027])"},{"line_number":385,"context_line":"            return dict(test_service.fake_service, id\u003d2, **values)"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"        self.stubs.Set(db, \"service_update\", _service_update)"},{"line_number":388,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1ae5cdf2_132b0595","line":385,"updated":"2014-06-02 16:21:07.000000000","message":"Should this be id\u003dservice_id ?","commit_id":"2c6bb3d4277b4d739b85ba1c3b16fda8fbfcd3af"}],"nova/tests/objects/test_compute_node.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7922d2a1cd8906d8e410872a1f9c811f9c03cd8f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                         comparators\u003d{\u0027stats\u0027: self.json_comparator})"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_set_id_failure(self):"},{"line_number":118,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_create\u0027)"},{"line_number":119,"context_line":"        db.compute_node_create(self.context, {}).AndReturn("},{"line_number":120,"context_line":"            fake_compute_node)"},{"line_number":121,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_5071f5de","line":118,"updated":"2014-05-23 17:21:50.000000000","message":"Please use mock for all new unit tests, please. This should look like this, instead:\n\n @mock.patch.object(db, \u0027compute_node_create\u0027,\n                    return_value\u003dfake_compute_node)\n def test_set_id_failure(self, db_mock):\n     compute \u003d compute_node.ComputeNode()\n     compute.create(self.context)\n     self.assertRaises(exception.ReadOnlyFieldError, setattr,\n                       compute, \u0027id\u0027, 124)","commit_id":"7272666ebe28919a32d30b1c34284044c1ab9199"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"e7485e3ccb08c105ceea887522831629f5b45815","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                         comparators\u003d{\u0027stats\u0027: self.json_comparator})"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def test_set_id_failure(self):"},{"line_number":118,"context_line":"        self.mox.StubOutWithMock(db, \u0027compute_node_create\u0027)"},{"line_number":119,"context_line":"        db.compute_node_create(self.context, {}).AndReturn("},{"line_number":120,"context_line":"            fake_compute_node)"},{"line_number":121,"context_line":"        self.mox.ReplayAll()"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_4b13060d","line":118,"in_reply_to":"7adec928_5071f5de","updated":"2014-05-23 17:40:06.000000000","message":"Sure.","commit_id":"7272666ebe28919a32d30b1c34284044c1ab9199"}],"nova/tests/objects/test_service.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7922d2a1cd8906d8e410872a1f9c811f9c03cd8f","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        service_obj \u003d service.Service()"},{"line_number":116,"context_line":"        service_obj.create(self.context)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ReadOnlyFieldError, setattr,"},{"line_number":118,"context_line":"                          service_obj, \u0027id\u0027, 124)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _test_destroy(self):"},{"line_number":121,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_destroy\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_50481587","line":118,"updated":"2014-05-23 17:21:50.000000000","message":"Not entirely sure it\u0027s necessary to have this test at all. All of this code is essentially identical to the compute node unit test of the same name, and other than the name of the subclass, the same exact code is executed...","commit_id":"7272666ebe28919a32d30b1c34284044c1ab9199"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6b489c9e5baece73303096d584d965e8bd54a220","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        service_obj \u003d service.Service()"},{"line_number":116,"context_line":"        service_obj.create(self.context)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ReadOnlyFieldError, setattr,"},{"line_number":118,"context_line":"                          service_obj, \u0027id\u0027, 124)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _test_destroy(self):"},{"line_number":121,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_destroy\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_0bbe5ed4","line":118,"in_reply_to":"7adec928_2b279a65","updated":"2014-05-23 17:41:56.000000000","message":"Yes, that is a fair point. OK, ignore my comment! :)","commit_id":"7272666ebe28919a32d30b1c34284044c1ab9199"},{"author":{"_account_id":4573,"name":"yunhong-jiang","email":"yunhong.jiang@intel.com","username":"yunhong-jiang"},"change_message_id":"e7485e3ccb08c105ceea887522831629f5b45815","unresolved":false,"context_lines":[{"line_number":115,"context_line":"        service_obj \u003d service.Service()"},{"line_number":116,"context_line":"        service_obj.create(self.context)"},{"line_number":117,"context_line":"        self.assertRaises(exception.ReadOnlyFieldError, setattr,"},{"line_number":118,"context_line":"                          service_obj, \u0027id\u0027, 124)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _test_destroy(self):"},{"line_number":121,"context_line":"        self.mox.StubOutWithMock(db, \u0027service_destroy\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7adec928_2b279a65","line":118,"in_reply_to":"7adec928_50481587","updated":"2014-05-23 17:40:06.000000000","message":"So what will happen if someday, the read_only field is removed from the object definition wrongly?","commit_id":"7272666ebe28919a32d30b1c34284044c1ab9199"}]}
