)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"03bd1d510aba0f20757dbe7fae29858de9a42efd","unresolved":false,"context_lines":[{"line_number":7,"context_line":"objects: Add update_fields method in base class."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For usage convenience, add in base class update_fields method. This would"},{"line_number":10,"context_line":"handle the updating of allowed fields, leaving the fields_no_update without"},{"line_number":11,"context_line":"modification."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Usage of update_fields for SubnetPool integration in db_base_plugin_v2."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1aa78d24_91341cfc","line":10,"range":{"start_line":10,"start_character":71,"end_line":10,"end_character":74},"updated":"2016-07-07 21:53:18.000000000","message":"nit: this exceeds the limit of the characters in the descriptions","commit_id":"275ae9b9ebd297a30c388afcfd900e6d88cca756"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"8540a1ed26c769327ce99aa31b383f44defce4f8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"objects: Add update_fields method in base class."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For usage convenience, add in base class update_fields method. This would"},{"line_number":10,"context_line":"handle the updating of allowed fields, leaving the fields_no_update without"},{"line_number":11,"context_line":"modification."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_8d2f86a0","line":9,"range":{"start_line":9,"start_character":72,"end_line":9,"end_character":73},"updated":"2016-07-25 14:13:30.000000000","message":"nit: this exceeds the limit of characters","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"8540a1ed26c769327ce99aa31b383f44defce4f8","unresolved":false,"context_lines":[{"line_number":7,"context_line":"objects: Add update_fields method in base class."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"For usage convenience, add in base class update_fields method. This would"},{"line_number":10,"context_line":"handle the updating of allowed fields, leaving the fields_no_update without"},{"line_number":11,"context_line":"modification."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Usage of update_fields for SubnetPool integration in db_base_plugin_v2 and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_6d017206","line":10,"range":{"start_line":10,"start_character":72,"end_line":10,"end_character":75},"updated":"2016-07-25 14:13:30.000000000","message":"ditto: line 9","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"8540a1ed26c769327ce99aa31b383f44defce4f8","unresolved":false,"context_lines":[{"line_number":10,"context_line":"handle the updating of allowed fields, leaving the fields_no_update without"},{"line_number":11,"context_line":"modification."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Usage of update_fields for SubnetPool integration in db_base_plugin_v2 and"},{"line_number":14,"context_line":"for trunk plugin update_trunk."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: Ia1fb22e75d71b1baf1b4a8fed1b185c250a41c1c"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"dada55a8_6d02110b","line":13,"range":{"start_line":13,"start_character":72,"end_line":13,"end_character":74},"updated":"2016-07-25 14:13:30.000000000","message":"ditto: line 9","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"}],"neutron/objects/base.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"03bd1d510aba0f20757dbe7fae29858de9a42efd","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.update_fields(obj_data, forbidden_keys\u003dself.primary_keys,"},{"line_number":450,"context_line":"                           reset_changes\u003dreset_changes)"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    def update_fields(self, obj_data, forbidden_keys\u003dNone,"},{"line_number":453,"context_line":"                      reset_changes\u003dFalse):"},{"line_number":454,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_344a7628","line":452,"range":{"start_line":452,"start_character":38,"end_line":452,"end_character":57},"updated":"2016-07-07 21:53:18.000000000","message":"I\u0027m not sure if which cases this argument should be provided.  If the idea is to skip some fields during the update, this argument should be added to the field_no_update list instead of replace it.  IMHO, the usage of self.fields_no_update has be mandatory.","commit_id":"275ae9b9ebd297a30c388afcfd900e6d88cca756"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"036fa1a1039d917b0f6bba23efa748f94c62af41","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.update_fields(obj_data, forbidden_keys\u003dself.primary_keys,"},{"line_number":450,"context_line":"                           reset_changes\u003dreset_changes)"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    def update_fields(self, obj_data, forbidden_keys\u003dNone,"},{"line_number":453,"context_line":"                      reset_changes\u003dFalse):"},{"line_number":454,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_f45200dd","line":452,"range":{"start_line":452,"start_character":38,"end_line":452,"end_character":57},"in_reply_to":"1aa78d24_344a7628","updated":"2016-07-12 13:21:33.000000000","message":"I agree with Victor here, Artur can you tell us more regarding the use case?","commit_id":"275ae9b9ebd297a30c388afcfd900e6d88cca756"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"d8c7d31e29261e7ba46ca5042362cf7598c4fbcc","unresolved":false,"context_lines":[{"line_number":449,"context_line":"        self.update_fields(obj_data, forbidden_keys\u003dself.primary_keys,"},{"line_number":450,"context_line":"                           reset_changes\u003dreset_changes)"},{"line_number":451,"context_line":""},{"line_number":452,"context_line":"    def update_fields(self, obj_data, forbidden_keys\u003dNone,"},{"line_number":453,"context_line":"                      reset_changes\u003dFalse):"},{"line_number":454,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_6d0ab1d3","line":452,"range":{"start_line":452,"start_character":38,"end_line":452,"end_character":57},"in_reply_to":"1aa78d24_f45200dd","updated":"2016-07-12 19:26:49.000000000","message":"I agree with you so I have removed the non-identifying fields method and leave only the update_fields method. Please check PS2.","commit_id":"275ae9b9ebd297a30c388afcfd900e6d88cca756"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"8540a1ed26c769327ce99aa31b383f44defce4f8","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            keys[key] \u003d getattr(self, key)"},{"line_number":483,"context_line":"        return keys"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def update_fields(self, obj_data, reset_changes\u003dFalse):"},{"line_number":486,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        :param obj_data: the full set of object data"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_8d9b05c9","line":485,"range":{"start_line":485,"start_character":52,"end_line":485,"end_character":57},"updated":"2016-07-25 14:13:30.000000000","message":"I\u0027ve seen that all the calls to this function use reset_changes as True, I\u0027m wondering if we can use True instead of False.","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"a8b2508ae25d7bd319343ade1be326c5c17ad177","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            keys[key] \u003d getattr(self, key)"},{"line_number":483,"context_line":"        return keys"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def update_fields(self, obj_data, reset_changes\u003dFalse):"},{"line_number":486,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        :param obj_data: the full set of object data"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_cde4abe1","line":485,"range":{"start_line":485,"start_character":52,"end_line":485,"end_character":57},"in_reply_to":"dada55a8_6a3da58e","updated":"2016-07-26 10:23:46.000000000","message":"OK, I misinterpreted the code for ovo base class. It indeed sets changes for all arguments passed.","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"0543baf3e633634eba055fafcaa8dc007d1abd8a","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            keys[key] \u003d getattr(self, key)"},{"line_number":483,"context_line":"        return keys"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def update_fields(self, obj_data, reset_changes\u003dFalse):"},{"line_number":486,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        :param obj_data: the full set of object data"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_b90f26e0","line":485,"range":{"start_line":485,"start_character":52,"end_line":485,"end_character":57},"in_reply_to":"dada55a8_8d9b05c9","updated":"2016-07-25 16:49:29.000000000","message":"? it\u0027s not the case in subnetpool.py file the least. That said, I wonder why we need to reset changes in the first place. I don\u0027t see a need in existing usage patterns, because objects with clean slate (just after __init__) are used to trigger the method, and new objects have _changes \u003d set(). Should we remove the argument?","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"5b0ceae7b713dbbeeb5f5661889d567d6b28dc29","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            keys[key] \u003d getattr(self, key)"},{"line_number":483,"context_line":"        return keys"},{"line_number":484,"context_line":""},{"line_number":485,"context_line":"    def update_fields(self, obj_data, reset_changes\u003dFalse):"},{"line_number":486,"context_line":"        \"\"\"Updates fields of an object that are not forbidden to be updated."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        :param obj_data: the full set of object data"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_6a3da58e","line":485,"range":{"start_line":485,"start_character":52,"end_line":485,"end_character":57},"in_reply_to":"dada55a8_b90f26e0","updated":"2016-07-26 10:00:01.000000000","message":"I have looked into use case and for qos_plugin, the reset changes is needed because of usage model, you create the new object passing ID, then you set the data to be updated and you call update. If there is no reset_changes, the update method would try to update the ID passed in rule object constructor. So I would leave the reset_changes in place. It is needed for QoS plugin.\n\nThe code example:\nrule_update_data \u003d {\u0027max_kbps\u0027: 123}\n# rule with rule_id is already existing\nrule \u003d rule_cls(ctx, id\u003drule_id)\nrule.update(rule_update_data)\n\u003e\u003e rule.obj_what_changed()\n\u003e\u003e set([\u0027max_kbps\u0027, \u0027id\u0027])\nrule.update(rule_update_data, reset_changes\u003dTrue)\n\u003e\u003e rule.obj_what_changed()\n\u003e\u003e set([\u0027max_kbps\u0027])\n\nThe second use case is where you are modifying object fetched by get_object, and this case is not requiring to reset the changes on object.\n\nFor example:\nrule_update_data \u003d {\u0027max_kbps\u0027: 123}\nrule \u003d RuleOVO.get_object(ctx, id\u003drule_id)\nrule.update_fields(rule_update_data)\n\u003e\u003e rule.obj_what_changed()\n\u003e\u003e set([\u0027max_kbps\u0027])","commit_id":"e5a95027dcd7f7680855dc1e3cf832530e7f7b14"}]}
