)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b47369fb576ddff0c6110a517c2f3a35acbeb4db","unresolved":false,"context_lines":[{"line_number":11,"context_line":"passing the context in registry notification payloads appears to be"},{"line_number":12,"context_line":"common practice."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Adding the trunk dict to the payload will make it readily"},{"line_number":15,"context_line":"available to subscribers without requiring a DB call to fetch it."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Partially-implements: blueprint vlan-aware-vms"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_39e26202","line":14,"updated":"2016-07-13 22:35:52.000000000","message":"this is stale.","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"660b1965ed4bef99e5584b918f4521b824281863","unresolved":false,"context_lines":[{"line_number":11,"context_line":"passing the context in registry notification payloads appears to be"},{"line_number":12,"context_line":"common practice."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Adding the trunk dict to the payload will make it readily"},{"line_number":15,"context_line":"available to subscribers without requiring a DB call to fetch it."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Partially-implements: blueprint vlan-aware-vms"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1aa78d24_3977023d","line":14,"in_reply_to":"1aa78d24_39e26202","updated":"2016-07-13 22:39:39.000000000","message":"Done","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"14574ef8f143abc43a14ac566c51c579f192ebbb","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add trunk create/delete notifications and augment subport notifications"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Registry notifications should be added for trunk creation/deletion, and"},{"line_number":10,"context_line":"SDN controllers as subscribers will need more callbacks as PRECOMMIT"},{"line_number":11,"context_line":"events. The subport notification payloads should also include the"},{"line_number":12,"context_line":"context (as common practice so that subscribers have access to it) and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"dada55a8_be2cec02","line":9,"updated":"2016-07-20 17:31:15.000000000","message":"In the interest of avoiding to tweak the notifications in the future, I wonder if we should take the time and formalize the notification payload a bit more. Perhaps we can define a structure for the payload and use the common format across all notifications. See inline for details.","commit_id":"044a880cd08e4b71f913d756585cdd24ddaaa69c"}],"neutron/services/trunk/callbacks.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"c544408299a3291dd911fd0e01e974b9f06fff99","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_dd15fd9b","line":17,"range":{"start_line":17,"start_character":6,"end_line":17,"end_character":18},"updated":"2016-07-22 12:43:32.000000000","message":"Would it make sense to introduce this as versioned object? What\u0027s the plan for future when we\u0027ll have running newer server (with a difference in this class) versus old registry subscribers?","commit_id":"75a3d688a822064f68564f1c0ca1f170aa512e0f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5197ca2f0f9c3c09ad994de1d1c74571e3daeaf5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_0f84e508","line":17,"range":{"start_line":17,"start_character":6,"end_line":17,"end_character":18},"in_reply_to":"dada55a8_3e3f61b5","updated":"2016-07-26 15:38:17.000000000","message":"Boden is working along similar lines...baby steps...we\u0027ll get there eventually :)","commit_id":"75a3d688a822064f68564f1c0ca1f170aa512e0f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"abfcb2968bebcccd54c28bffb4e5c73366faff12","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_78404408","line":17,"range":{"start_line":17,"start_character":6,"end_line":17,"end_character":18},"in_reply_to":"dada55a8_74222303","updated":"2016-07-22 21:54:18.000000000","message":"This is meant to be a wrapper, and to be used in process. So Everything is upgraded at once.","commit_id":"75a3d688a822064f68564f1c0ca1f170aa512e0f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"cd02cb7619d426261047cce761f0a2190a3972e3","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_3e3f61b5","line":17,"range":{"start_line":17,"start_character":6,"end_line":17,"end_character":18},"in_reply_to":"dada55a8_78404408","updated":"2016-07-26 14:41:00.000000000","message":"Yes, it\u0027s just in-process.\n\nI find he idea of having callback payloads defined as objects makes a lot of sense, because we are providing a contract between the callback sender and the callback receivers, instead of dicts which are open to anything.\n\nIt gives us a place in code to look at the payload.\n\nAnd, if we wanted to propagate this kind of payload like in [1] it\u0027s just a matter of making that layer smart about how the trunk payloads are in this case, and fetching the specific fields to be pushed over the wire.\n\n\n[1] https://review.openstack.org/#/c/336730/4/neutron/api/rpc/agentnotifiers/object_dispatch.py","commit_id":"75a3d688a822064f68564f1c0ca1f170aa512e0f"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"b5d57278a1ea447d2c7b08a004fdbcce91e2fa97","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":11,"id":"dada55a8_74222303","line":17,"range":{"start_line":17,"start_character":6,"end_line":17,"end_character":18},"in_reply_to":"dada55a8_dd15fd9b","updated":"2016-07-22 15:35:50.000000000","message":"That is an interesting thought. The trunk and subports passed in this class are OVOs themselves, and this class is meant to provide as much info in the payload as possible so that we never have to change it again.\n\nI\u0027m not overly familiar with them yet, but I thought OVOs were mainly for db interaction, whereas this object doesn\u0027t come from the db. Do we have other examples of using OVO in such a manner?","commit_id":"75a3d688a822064f68564f1c0ca1f170aa512e0f"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7dc6a854f00b0302e0111e89b56048ef49784633","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"},{"line_number":21,"context_line":"                 original_trunk\u003dNone, subports\u003dNone):"}],"source_content_type":"text/x-python","patch_set":13,"id":"dada55a8_5349e2cf","line":18,"updated":"2016-07-22 22:43:28.000000000","message":"perhaps we may want to expand on the meaning of the class members and how they are meant to be used. If you must respin.","commit_id":"6f2d9b5d3c55532e65ac83c5e6ffaaee573af139"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"176e2f8c3855c30817b80ea9ee0a87be74878d5b","unresolved":false,"context_lines":[{"line_number":23,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":24,"context_line":"        self.current_trunk \u003d current_trunk"},{"line_number":25,"context_line":"        self.original_trunk \u003d original_trunk"},{"line_number":26,"context_line":"        self.subports \u003d subports if subports else []"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __eq__(self, other):"},{"line_number":29,"context_line":"        return (isinstance(other, self.__class__) and"}],"source_content_type":"text/x-python","patch_set":13,"id":"dada55a8_534e02c2","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":18},"updated":"2016-07-22 22:45:59.000000000","message":"I have been thinking how easy/better to infer this information, because this is meant to contain the diff between the subports for current_trunk and original_trunk. Have you thought about it?","commit_id":"6f2d9b5d3c55532e65ac83c5e6ffaaee573af139"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"8e5c591946d3f62859f9a6456be81ad2e2257c81","unresolved":false,"context_lines":[{"line_number":23,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":24,"context_line":"        self.current_trunk \u003d current_trunk"},{"line_number":25,"context_line":"        self.original_trunk \u003d original_trunk"},{"line_number":26,"context_line":"        self.subports \u003d subports if subports else []"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __eq__(self, other):"},{"line_number":29,"context_line":"        return (isinstance(other, self.__class__) and"}],"source_content_type":"text/x-python","patch_set":13,"id":"dada55a8_5620b0f7","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":18},"in_reply_to":"dada55a8_534e02c2","updated":"2016-07-22 23:30:06.000000000","message":"@Armando I think the extra complexity required to convert both lists into sets and take the difference of them might be worse than just passing in the list of affected subports explicitly. The former simplifies the calling code a bit but adds more complexity into this simple class that\u0027s mainly just to aggregate some data. I considered possibly using a namedtuple here as well but preferred the default arguments in the initializer.\n\n@Ryan that is correct.","commit_id":"6f2d9b5d3c55532e65ac83c5e6ffaaee573af139"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"04bfd2feef217227322687c84c4e5da486fb93ef","unresolved":false,"context_lines":[{"line_number":23,"context_line":"        self.trunk_id \u003d trunk_id"},{"line_number":24,"context_line":"        self.current_trunk \u003d current_trunk"},{"line_number":25,"context_line":"        self.original_trunk \u003d original_trunk"},{"line_number":26,"context_line":"        self.subports \u003d subports if subports else []"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    def __eq__(self, other):"},{"line_number":29,"context_line":"        return (isinstance(other, self.__class__) and"}],"source_content_type":"text/x-python","patch_set":13,"id":"dada55a8_d6e660e7","line":26,"range":{"start_line":26,"start_character":17,"end_line":26,"end_character":18},"in_reply_to":"dada55a8_534e02c2","updated":"2016-07-22 23:19:04.000000000","message":"I had thought that the meaning of subports depends on the event type. If we see an AFTER_CREATE, subports would be the subports that were added. In the case of AFTER_REMOVE, subports are the subports that were removed.","commit_id":"6f2d9b5d3c55532e65ac83c5e6ffaaee573af139"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"1d588863805aecc8f66fe9b2347f9fd63aebbdf2","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"class TrunkPayload(object):"},{"line_number":18,"context_line":"    \"\"\"Payload for trunk-related callback registry notifications.\"\"\""},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"    def __init__(self, context, trunk_id, current_trunk\u003dNone,"}],"source_content_type":"text/x-python","patch_set":14,"id":"dada55a8_1e0c1deb","line":17,"updated":"2016-07-26 14:46:09.000000000","message":"/me thinking about how cool would be to auto-document our callbacks interfaces by inspecting our callbacks pushers dynamically.","commit_id":"7bc501b2d7c930ff3976f13a15c4f235319d46a2"}],"neutron/services/trunk/plugin.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"203cf1effa84abc5a40745910d7cd1b52fce08a7","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_1242f767","line":145,"updated":"2016-07-13 15:31:08.000000000","message":"why are we not passing the trunk object here?","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c90a2f7d6e7f5fca1903cf237c1c685a82e414d8","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_bb940337","line":145,"in_reply_to":"1aa78d24_0d0da8e8","updated":"2016-07-26 14:29:27.000000000","message":"One of the advantages of OVOs was avoiding the need to pass dictionaries which are very unnatural tu inspect and use dict[\u0027xxx\u0027] ... \n\nPlease stick to OVOs, I\u0027m looping in Ihar anyway to have a look at this.","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"30bd2a341a205f44187e4963e9b1bb63ba17f9e0","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_888eb876","line":145,"in_reply_to":"1aa78d24_1242f767","updated":"2016-07-13 15:46:28.000000000","message":"Currently Ryan and I don\u0027t anticipate needing to make DB changes to the trunk on subport add/remove, hence I\u0027m only passing the dict here rather than the full OVO.","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"a19edda3bfac1f38ce0ee78470bb9a94947b964d","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_0d0da8e8","line":145,"in_reply_to":"1aa78d24_147ad577","updated":"2016-07-13 20:54:58.000000000","message":"Since it seems like it doesn\u0027t matter either way, perhaps we should just pass the full OVO to be consistent with passing the SubPort OVOs.","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"1f22b1fd4a38e3167c063b7e4186889d7e1c2ead","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_147ad577","line":145,"in_reply_to":"1aa78d24_888eb876","updated":"2016-07-13 19:51:41.000000000","message":"I can\u0027t envision a scenario where we need the OVO. That said, I\u0027m not sure what it hurts to pass the OVO either.","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"6c0d89c8421ebca99e43616b493300a67aab5e42","unresolved":false,"context_lines":[{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        registry.notify("},{"line_number":144,"context_line":"            constants.SUBPORTS, events.AFTER_CREATE, self, context\u003dcontext,"},{"line_number":145,"context_line":"            trunk\u003dtrunk.to_dict(), added_subports\u003dadded_subports)"},{"line_number":146,"context_line":"        return trunk"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_3bf6538f","line":145,"in_reply_to":"dada55a8_bb940337","updated":"2016-07-26 14:31:21.000000000","message":"Yes, I think we should try to push objects thru the registry.","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"203cf1effa84abc5a40745910d7cd1b52fce08a7","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            trunk.sub_ports \u003d list(current_subports.values())"},{"line_number":178,"context_line":"            registry.notify("},{"line_number":179,"context_line":"                constants.SUBPORTS, events.AFTER_DELETE, self, context\u003dcontext,"},{"line_number":180,"context_line":"                trunk\u003dtrunk.to_dict(), removed_subports\u003dremoved_subports)"},{"line_number":181,"context_line":"            return trunk"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"    @db_base_plugin_common.filter_fields"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_5260ff00","line":180,"updated":"2016-07-13 15:31:08.000000000","message":"ditto","commit_id":"578dce257b6a6d1c3970f3eb0ffa92ec34a86c06"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"b52d994ce0edf2e6d3d6287624e6f5bb229c20f0","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            registry.notify(constants.SUBPORTS, events.PRECOMMIT_DELETE,"},{"line_number":197,"context_line":"                            self, **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"},{"line_number":198,"context_line":"                                     \u0027removed_subports\u0027: removed_subports})"},{"line_number":199,"context_line":"        trunk.obj_reset_changes()"},{"line_number":200,"context_line":"        registry.notify("},{"line_number":201,"context_line":"            constants.SUBPORTS, events.AFTER_DELETE, self,"},{"line_number":202,"context_line":"            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_b05ac781","line":199,"updated":"2016-07-18 23:56:34.000000000","message":"I\u0027m re-thinking whether this was the right approach. We may actually want to pass the OVO without having its state reset like we do here.","commit_id":"3cd98bfe775513974ff7b3169c6a0f52ddf291b5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4bec8a96f9797ebc092c5a90216ff10bf8bbc100","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            registry.notify(constants.SUBPORTS, events.PRECOMMIT_DELETE,"},{"line_number":197,"context_line":"                            self, **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"},{"line_number":198,"context_line":"                                     \u0027removed_subports\u0027: removed_subports})"},{"line_number":199,"context_line":"        trunk.obj_reset_changes()"},{"line_number":200,"context_line":"        registry.notify("},{"line_number":201,"context_line":"            constants.SUBPORTS, events.AFTER_DELETE, self,"},{"line_number":202,"context_line":"            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"}],"source_content_type":"text/x-python","patch_set":5,"id":"dada55a8_6c068acf","line":199,"in_reply_to":"dada55a8_b05ac781","updated":"2016-07-19 17:10:04.000000000","message":"I\u0027m going to propose an alternate approach in the next PS. Rather than doing\n\ntrunk.sub_ports \u003d ...\n\nwe can avoid resetting sub_ports by doing\n\ndel trunk.sub_ports[:]\ntrunk.sub_ports.extend(...)\n\nThis avoids making the OVO think the \u0027sub_ports\u0027 field is new, similar to how just appending to trunk.sub_ports in add_subports() doesn\u0027t make the OVO think sub_ports is new. trunk.sub_ports is the same list; it has only changed items in the list.","commit_id":"3cd98bfe775513974ff7b3169c6a0f52ddf291b5"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"19e8ac7d96bb300efa49258516c2c770ac4b7909","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                removed_subports.append(subport_obj)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"            del trunk.sub_ports[:]"},{"line_number":201,"context_line":"            trunk.sub_ports.extend(current_subports.values())"},{"line_number":202,"context_line":"            registry.notify(constants.SUBPORTS, events.PRECOMMIT_DELETE, self,"},{"line_number":203,"context_line":"                            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"},{"line_number":204,"context_line":"                               \u0027removed_subports\u0027: removed_subports})"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_274e5f96","line":201,"updated":"2016-07-19 23:46:59.000000000","message":"If someone passes a blank list I don\u0027t think we should send any notifications, PRECOMMIT_DELETE or AFTER_DELETE.","commit_id":"3ccb9339fcc2420ddb2a3e04d8b2b2477c0a316c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"383995bebddc7947568fc137a162bdbdd98198a7","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                removed_subports.append(subport_obj)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"            del trunk.sub_ports[:]"},{"line_number":201,"context_line":"            trunk.sub_ports.extend(current_subports.values())"},{"line_number":202,"context_line":"            registry.notify(constants.SUBPORTS, events.PRECOMMIT_DELETE, self,"},{"line_number":203,"context_line":"                            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"},{"line_number":204,"context_line":"                               \u0027removed_subports\u0027: removed_subports})"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_e49c18c2","line":201,"in_reply_to":"dada55a8_274e5f96","updated":"2016-07-20 16:19:51.000000000","message":"I think I agree, but I also was thinking the same thing for add_subports as well. It seems like subscribers would make it a no-op anyways if the added/removed_subports list was empty. Now that I\u0027ve had more time to think about it, I can\u0027t envision any subscribers changing state on a subport AFTER_DELETE/AFTER_CREATE, because by definition, nothing happened, and there\u0027s no useful data in a subport AFTER_CREATE/DELETE with an empty list of subports.","commit_id":"3ccb9339fcc2420ddb2a3e04d8b2b2477c0a316c"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"7c787974ac0301fca8acd41353652fe3bb151ca2","unresolved":false,"context_lines":[{"line_number":198,"context_line":"                removed_subports.append(subport_obj)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"            del trunk.sub_ports[:]"},{"line_number":201,"context_line":"            trunk.sub_ports.extend(current_subports.values())"},{"line_number":202,"context_line":"            registry.notify(constants.SUBPORTS, events.PRECOMMIT_DELETE, self,"},{"line_number":203,"context_line":"                            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk,"},{"line_number":204,"context_line":"                               \u0027removed_subports\u0027: removed_subports})"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_4a3ecb28","line":201,"in_reply_to":"dada55a8_e49c18c2","updated":"2016-07-20 17:01:46.000000000","message":"Consider the case of https://review.openstack.org/#/c/341846/2/neutron/services/trunk/drivers/openvswitch.py. This driver actually acts on the notification by querying the core plugin for the parent port of the trunk. We could somehow make it a no-op in the driver, but that puts the onus on the driver implementation. I\u0027m a fan of not even sending a notification if nothing changed. I\u0027m not a fan of false alarms in real life, and that philosophy translates to Neutron as well :)","commit_id":"3ccb9339fcc2420ddb2a3e04d8b2b2477c0a316c"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"14574ef8f143abc43a14ac566c51c579f192ebbb","unresolved":false,"context_lines":[{"line_number":108,"context_line":"                **{\u0027context\u0027: context, \u0027trunk\u0027: trunk_obj})"},{"line_number":109,"context_line":"        registry.notify("},{"line_number":110,"context_line":"            constants.TRUNK, events.AFTER_CREATE, self,"},{"line_number":111,"context_line":"            **{\u0027context\u0027: context, \u0027trunk\u0027: trunk_obj})"},{"line_number":112,"context_line":"        return trunk_obj"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    @db_base_plugin_common.convert_result_to_dict"}],"source_content_type":"text/x-python","patch_set":10,"id":"dada55a8_a1532d16","line":111,"updated":"2016-07-20 17:31:15.000000000","message":"perhaps the payload below can gather the needs of all the notifications we need. I\u0027d like us to explore this.\n\n    class TrunkPayload(object):\n\n        context # the context\n        trunk_id # the UUID of the trunk affected by the operation\n        current_trunk # the current state of the trunk object, can be None\n        original_trunk  # the original state of the trunk object, can be None\n        subports # the subports affected by the operation","commit_id":"044a880cd08e4b71f913d756585cdd24ddaaa69c"}],"neutron/tests/unit/services/trunk/test_plugin.py":[{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"eb3979ca34fbe17e2a6b22c66c184d42ad32d39d","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            trunk_after_remove.sub_ports \u003d trunk_after_remove.sub_ports"},{"line_number":87,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":88,"context_line":"                             else trunk_after_remove)"},{"line_number":89,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_193fa688","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":71},"updated":"2016-07-13 22:31:47.000000000","message":"NOTE: this no-op is needed in order to \"trick\" the OVO equality comparison in the mock assertion below. This is because trunk_after_remove was \"retrieved\" without changing its subports, whereas the trunk that is passed in the notification payload had its subports changed. This sets an annoying \u0027versioned_object.changes\u0027 field in the OVO.obj_to_primitive() dict that causes the comparison to work.\n\nThe no-op isn\u0027t required for trunk_after_add because the \u0027sub_ports\u0027 isn\u0027t set, it\u0027s just appended to.","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b47369fb576ddff0c6110a517c2f3a35acbeb4db","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            trunk_after_remove.sub_ports \u003d trunk_after_remove.sub_ports"},{"line_number":87,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":88,"context_line":"                             else trunk_after_remove)"},{"line_number":89,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_b9d5b21c","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":71},"in_reply_to":"1aa78d24_193fa688","updated":"2016-07-13 22:35:52.000000000","message":"This gotcha without a note is kinda dangerous, is there any other way to avoid this?","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"c1538ce268d96bd0fca2e310a53414b2e2c955cb","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            trunk_after_remove.sub_ports \u003d trunk_after_remove.sub_ports"},{"line_number":87,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":88,"context_line":"                             else trunk_after_remove)"},{"line_number":89,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_972e8c8a","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":71},"in_reply_to":"1aa78d24_79bfcaaa","updated":"2016-07-14 20:30:40.000000000","message":"Is there a method we can call on the OVO that will clear some state before we send on the payload? Then we wouldn\u0027t have to worry about jumping through this hoop. ie would calling something like reset_changes() on the OVO before sending it on the payload help?","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"7319bd7ae35d08e151d12fd64f2716c0b02df25b","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            trunk_after_remove.sub_ports \u003d trunk_after_remove.sub_ports"},{"line_number":87,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":88,"context_line":"                             else trunk_after_remove)"},{"line_number":89,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_17cc5cba","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":71},"in_reply_to":"1aa78d24_972e8c8a","updated":"2016-07-14 20:37:00.000000000","message":"We can call trunk.obj_reset_changes() before passing it in the payload. That should remove the need for this gotcha, and the subscribers gain nothing from knowing that \u0027sub_ports\u0027 changed on the trunk b/c that\u0027s obvious from the event.\n\nLook for it in the next PS.","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"660b1965ed4bef99e5584b918f4521b824281863","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            trunk_after_remove.sub_ports \u003d trunk_after_remove.sub_ports"},{"line_number":87,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":88,"context_line":"                             else trunk_after_remove)"},{"line_number":89,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_79bfcaaa","line":86,"range":{"start_line":86,"start_character":12,"end_line":86,"end_character":71},"in_reply_to":"1aa78d24_b9d5b21c","updated":"2016-07-13 22:39:39.000000000","message":"I tried mocking some of the OVO internals, but that broke OVO. An alternative is setting trunk._changed_fields \u003d set([\u0027sub_ports\u0027]), which is a side-effect of the no-op above.\n\nShould I add a note about the gotcha?","commit_id":"0dee031cb101a6c4461a55359f9899b0dafbfc33"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"21edc0b20542e8db5ffbdafc03ac04d27da8f8e2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            subport_obj \u003d self._get_subport_obj(subport[\u0027port_id\u0027])"},{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":87,"context_line":"                             else trunk_after_remove)"},{"line_number":88,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_96606837","line":85,"updated":"2016-07-18 18:48:51.000000000","message":"I think I made a mistake when reviewing this part of the test code. We should split this so that we test add_subports and remove_subports individually and separately; if we do, most likely we would need the extraneous trunk.obj_reset_changes in the plugin code.\n\nHave you considered this?","commit_id":"9c91d519c3279d1b563f408b751ccf42372e383c"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"4416d4860ca87b4b69bb652fe960580e7224325b","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            subport_obj \u003d self._get_subport_obj(subport[\u0027port_id\u0027])"},{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":87,"context_line":"                             else trunk_after_remove)"},{"line_number":88,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_8263fe19","line":85,"in_reply_to":"dada55a8_96606837","updated":"2016-07-18 20:21:36.000000000","message":"@Armando I originally had this more split up into two methods, but there was some duplication between methods. If we split it back up, there will be some duplication due to the similar nature of the two notifications.\n\n@Ryan I may be able to have the mock callback also set an instance variable in this test class to the value of the trunk passed in the payload. Then we could compare the two using to_dict() and assert they\u0027re both Trunk objects. That would basically give us the coverage we have now, and we wouldn\u0027t need to call obj_reset_changes() in the plugin.","commit_id":"9c91d519c3279d1b563f408b751ccf42372e383c"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"6d4e387e4a07782945b519ddfeb1e71f425896f6","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            subport_obj \u003d self._get_subport_obj(subport[\u0027port_id\u0027])"},{"line_number":83,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":84,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":85,"context_line":"            trunk_after_remove \u003d self._get_trunk_obj(trunk[\u0027id\u0027])"},{"line_number":86,"context_line":"            payload_trunk \u003d (trunk_after_add if event \u003d\u003d events.AFTER_CREATE"},{"line_number":87,"context_line":"                             else trunk_after_remove)"},{"line_number":88,"context_line":"            payload \u003d {payload_key: [subport_obj],"}],"source_content_type":"text/x-python","patch_set":4,"id":"dada55a8_3cb7db3a","line":85,"in_reply_to":"dada55a8_96606837","updated":"2016-07-18 19:24:29.000000000","message":"Splitting this apart may be a nice thing to do for readability and maintenance purposes, but I\u0027m not sure how it mitigates the issues with the mock that motivated calling trunk.obj_reset_changes(). Could we somehow assert mock.ANY for the trunk in the payload. Maybe we could then add a second assertion to assert the to_dict() of payload matches payload_trunk?","commit_id":"9c91d519c3279d1b563f408b751ccf42372e383c"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"b52d994ce0edf2e6d3d6287624e6f5bb229c20f0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"dada55a8_f026ff14","line":101,"updated":"2016-07-18 23:56:34.000000000","message":"Let\u0027s get some test coverage on the PRECOMMIT events","commit_id":"3cd98bfe775513974ff7b3169c6a0f52ddf291b5"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"9334f292d62f8d753058910a12adf418b561e25b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"dada55a8_6c2dea45","line":101,"in_reply_to":"dada55a8_f026ff14","updated":"2016-07-19 17:15:02.000000000","message":"Done","commit_id":"3cd98bfe775513974ff7b3169c6a0f52ddf291b5"}]}
