)]}'
{"cinder/db/api.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"38a13c01886758b36826558e87f45d870702b2e8","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"    return IMPL.get_model_for_versioned_object(versioned_object)"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"def generic_operation(operation, model, *args, **kwargs):"},{"line_number":1202,"context_line":"    \"\"\"Allows get, update, create, destroy operations on a model.\"\"\""},{"line_number":1203,"context_line":"    return IMPL.generic_operation(operation, model, *args, **kwargs)"},{"line_number":1204,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"7aa08908_690213b6","line":1201,"range":{"start_line":1201,"start_character":0,"end_line":1201,"end_character":57},"updated":"2016-06-16 15:22:38.000000000","message":"So I mentioned in your other patch that I\u0027m a big fan of the consolidation of the API methods.  I should clarify here, I\u0027m a big fan of things like having a single get with filters instead of get_by_xx, get_by_yy etc.\n\nThis \"generic_operation\" idea is clever, but I think that having explicit operations \"get, update, create, destroy\" is a good thing.  I don\u0027t necessarily know that trickery on overloading a method to handle all of the base primitives like that is a good idea.\n\nJust seems like it makes things slightly more difficult to spot in the future.","commit_id":"41ddfcc78e9d26674e4fb670c1a90e4877e80afd"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8d6c4cb2b28d547957e0a6a93a423d68b4456544","unresolved":false,"context_lines":[{"line_number":1198,"context_line":"    return IMPL.get_model_for_versioned_object(versioned_object)"},{"line_number":1199,"context_line":""},{"line_number":1200,"context_line":""},{"line_number":1201,"context_line":"def generic_operation(operation, model, *args, **kwargs):"},{"line_number":1202,"context_line":"    \"\"\"Allows get, update, create, destroy operations on a model.\"\"\""},{"line_number":1203,"context_line":"    return IMPL.generic_operation(operation, model, *args, **kwargs)"},{"line_number":1204,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5a9d85d2_92ce79b2","line":1201,"range":{"start_line":1201,"start_character":0,"end_line":1201,"end_character":57},"in_reply_to":"7aa08908_690213b6","updated":"2016-06-21 15:56:24.000000000","message":"That was my original approach (you can see it in patch 5) but I ended up with some unnecessary code duplication.\n\nI could go back to having 4 different methods here and in the sqlalchemy/api.py file, but in the end they would all be doing the same thing since required code for all methods is the same, they only differ on the exception methods.","commit_id":"41ddfcc78e9d26674e4fb670c1a90e4877e80afd"}],"cinder/objects/base.py":[{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"490dc00b1b582286315c408a8445b143aafb3031","unresolved":false,"context_lines":[{"line_number":529,"context_line":"                if getattr(self, field) !\u003d current_field:"},{"line_number":530,"context_line":"                    # To prevent oslo from raising exception remove field if"},{"line_number":531,"context_line":"                    # it is a read only field."},{"line_number":532,"context_line":"                    if self.fields[field].read_only:"},{"line_number":533,"context_line":"                        delattr(self, field)"},{"line_number":534,"context_line":"                    setattr(self, field, current_field)"},{"line_number":535,"context_line":"        self.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_4e8616dc","line":532,"updated":"2016-06-12 08:34:04.000000000","message":"Why prevent oslo from raising exception? I think if codes set read_only field, there are problems about the codes. Cinder should raise the exception.\n\nAlthough currently Cinder doesn\u0027t use this mechanism.","commit_id":"58fead255ec0fb4daf6fa508249202c5b13cf3e3"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"472073aaee18cb0a69e4d6a55d1b59b527c63d60","unresolved":false,"context_lines":[{"line_number":529,"context_line":"                if getattr(self, field) !\u003d current_field:"},{"line_number":530,"context_line":"                    # To prevent oslo from raising exception remove field if"},{"line_number":531,"context_line":"                    # it is a read only field."},{"line_number":532,"context_line":"                    if self.fields[field].read_only:"},{"line_number":533,"context_line":"                        delattr(self, field)"},{"line_number":534,"context_line":"                    setattr(self, field, current_field)"},{"line_number":535,"context_line":"        self.obj_reset_changes()"}],"source_content_type":"text/x-python","patch_set":13,"id":"3aaa91ec_60743afd","line":532,"in_reply_to":"7aa08908_4e8616dc","updated":"2016-06-21 17:26:29.000000000","message":"Sorry, I forgot to answer your question.  The reason why we didn\u0027t want to raise the exception is because we were not really changing the values, we were actually reading them from the DB, but Versioned Objects mechanism misinterpreted it as a modification because we had already set a value to the field.","commit_id":"58fead255ec0fb4daf6fa508249202c5b13cf3e3"}],"cinder/objects/volume.py":[{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"ec064ae7255e068e4dc59da44ce30c9ad688ae68","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        \u0027admin_metadata\u0027: fields.DictOfStringsField(nullable\u003dTrue),"},{"line_number":111,"context_line":"        \u0027glance_metadata\u0027: fields.DictOfStringsField(nullable\u003dTrue),"},{"line_number":112,"context_line":"        \u0027volume_type\u0027: fields.ObjectField(\u0027VolumeType\u0027, nullable\u003dTrue),"},{"line_number":113,"context_line":"        \u0027volume_attachment\u0027: fields.ObjectField(\u0027VolumeAttachmentList\u0027,"},{"line_number":114,"context_line":"                                                nullable\u003dTrue),"},{"line_number":115,"context_line":"        \u0027consistencygroup\u0027: fields.ObjectField(\u0027ConsistencyGroup\u0027,"},{"line_number":116,"context_line":"                                               nullable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9abb7d3a_fba09fa7","line":113,"updated":"2016-06-03 07:23:32.000000000","message":"I noticed that you set all Object field as read_only except volume_attachment.\n\nBut in volume_create, even volume_attachment is changed, it will not be updated.\n\nhttps://github.com/openstack/cinder/blob/master/cinder/db/sqlalchemy/api.py#L1205\n\nSo I am wondering whether we can just ignore such object field during creation and updates. Not sure!","commit_id":"58fead255ec0fb4daf6fa508249202c5b13cf3e3"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8ecce1d1de3c9f5e673b60029db92522bdb26854","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        \u0027admin_metadata\u0027: fields.DictOfStringsField(nullable\u003dTrue),"},{"line_number":111,"context_line":"        \u0027glance_metadata\u0027: fields.DictOfStringsField(nullable\u003dTrue),"},{"line_number":112,"context_line":"        \u0027volume_type\u0027: fields.ObjectField(\u0027VolumeType\u0027, nullable\u003dTrue),"},{"line_number":113,"context_line":"        \u0027volume_attachment\u0027: fields.ObjectField(\u0027VolumeAttachmentList\u0027,"},{"line_number":114,"context_line":"                                                nullable\u003dTrue),"},{"line_number":115,"context_line":"        \u0027consistencygroup\u0027: fields.ObjectField(\u0027ConsistencyGroup\u0027,"},{"line_number":116,"context_line":"                                               nullable\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":13,"id":"7aa08908_db6e552e","line":113,"in_reply_to":"9abb7d3a_fba09fa7","updated":"2016-06-07 12:09:33.000000000","message":"The purpose of this patch is to create generic methods to remove code duplication, I have tried to changed behavior as little as possible, and since current code does not look into volume_attachment during creation or saving I haven\u0027t touched that.\n\nOn another patch we could easily add the read_only field to volume_attachment and volume_type.","commit_id":"58fead255ec0fb4daf6fa508249202c5b13cf3e3"}]}
