)]}'
{"neutron/services/trunk/constants.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9615955bab994e7fe833a33f363a5d8856ab2d3e","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"PARENT_PORT \u003d \u0027parent_port\u0027"},{"line_number":16,"context_line":"SUBPORT \u003d \u0027subport\u0027"},{"line_number":17,"context_line":"SUBPORTS \u003d \u0027subports\u0027"},{"line_number":18,"context_line":"TRUNK \u003d \u0027trunk\u0027"},{"line_number":19,"context_line":"TRUNK_PLUGIN \u003d \u0027trunk_plugin\u0027"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_60e39834","line":17,"updated":"2016-07-08 18:39:29.000000000","message":"not sure if we need a new resource literal, perhaps either one or the other would do.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"7690ea3f2c59f5cc6c76d0f74aac09992c17ecce","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"PARENT_PORT \u003d \u0027parent_port\u0027"},{"line_number":16,"context_line":"SUBPORT \u003d \u0027subport\u0027"},{"line_number":17,"context_line":"SUBPORTS \u003d \u0027subports\u0027"},{"line_number":18,"context_line":"TRUNK \u003d \u0027trunk\u0027"},{"line_number":19,"context_line":"TRUNK_PLUGIN \u003d \u0027trunk_plugin\u0027"},{"line_number":20,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_8d5faa74","line":17,"in_reply_to":"1aa78d24_60e39834","updated":"2016-07-08 19:19:49.000000000","message":"Ok, I\u0027ll go ahead and remove the singular one because the payload is a list of subports.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"}],"neutron/services/trunk/plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3f93b9ebf6cd1c13941f3a5a1b19be4e2acb098","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_203d10bc","line":144,"updated":"2016-07-07 23:59:09.000000000","message":"not sure, I\u0027d probably want to emit the notification even with empty payload, I might want to do something else in the callback...","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"7690ea3f2c59f5cc6c76d0f74aac09992c17ecce","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_ad8706d6","line":144,"in_reply_to":"1aa78d24_0a4ba02c","updated":"2016-07-08 19:19:49.000000000","message":"trunk[\u0027sub_ports\u0027] contains all of the existing subports, and I figured we are only interested in the new ones.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"de492aa2039d34381b99ecb58ec749969b8f64c5","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_82402309","line":144,"in_reply_to":"1aa78d24_203d10bc","updated":"2016-07-08 15:55:46.000000000","message":"What might you do with an empty payload? If we didn\u0027t add any subports, there isn\u0027t any action to take so why emit a notification? On the flip side, emitting an empty list and having the handlers perform a no-op on the notification does clean up the code and make it read a little better.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"32e609b52bfa18a81604d6199637092c28fdd790","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_34c87b74","line":144,"in_reply_to":"1aa78d24_20f95d4e","updated":"2016-07-08 21:12:19.000000000","message":"+1 to the approach you\u0027ve taken here Rawlin. We can always come back and add more to the payload. It\u0027s harder to remove things. I don\u0027t see the need, the list you would end up passing represents the delta created by adding subports anyway. I don\u0027t see a need to adjust existing subports on a subport add. That all points to just omitting the list of existing subports for now.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9615955bab994e7fe833a33f363a5d8856ab2d3e","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_0a4ba02c","line":144,"in_reply_to":"1aa78d24_7bcb191f","updated":"2016-07-08 18:39:29.000000000","message":"I think one way or another is equivalent at this point, but one could argue that this whole method should be a no-op if subports is empty.\n\nWhy not return trunk[\u0027sub_ports\u0027], what do we need the added_subports for?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"2fc12ce13fd94a7da5195bc415c060097011b180","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_20f95d4e","line":144,"in_reply_to":"1aa78d24_80fe5103","updated":"2016-07-08 20:01:08.000000000","message":"In terms of the couple scenarios I have in mind for this event (RPC push notifications and subport portbinding), neither seem like they\u0027d need the list of existing subports. Should we add it even if we don\u0027t think we\u0027ll use it? It makes more sense for an \"update\", but this operation is more like a \"create\" IMO.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"dd36a81ae7e797a36f21f408db317ab19ffcaa4a","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7bcb191f","line":144,"in_reply_to":"1aa78d24_82402309","updated":"2016-07-08 18:21:42.000000000","message":"Logically it doesn\u0027t make sense to me to emit an AFTER_CREATE event if nothing was CREATE\u0027d so none of the callbacks would need to be triggered, but we could leave that decision the the callbacks themselves.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"5ee5ba1743f88f315b1c17fbe16c8c8926c56677","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                trunk[\u0027sub_ports\u0027].append(obj)"},{"line_number":142,"context_line":"                added_subports.append(obj)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        if added_subports:"},{"line_number":145,"context_line":"            registry.notify("},{"line_number":146,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, added_subports)"},{"line_number":147,"context_line":"        return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_80fe5103","line":144,"in_reply_to":"1aa78d24_ad8706d6","updated":"2016-07-08 19:26:54.000000000","message":"Ok. Did you consider whether it\u0027s worth having a more elaborate payload that contains two lists containing separately the existing ones prior to the insert and the ones being added?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3f93b9ebf6cd1c13941f3a5a1b19be4e2acb098","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                removed_subports.append(subport_obj)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            trunk.sub_ports \u003d list(current_subports.values())"},{"line_number":179,"context_line":"            if removed_subports:"},{"line_number":180,"context_line":"                registry.notify("},{"line_number":181,"context_line":"                    constants.SUBPORTS, events.AFTER_DELETE, removed_subports)"},{"line_number":182,"context_line":"            return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_6047184c","line":179,"updated":"2016-07-07 23:59:09.000000000","message":"ditto.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9615955bab994e7fe833a33f363a5d8856ab2d3e","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                removed_subports.append(subport_obj)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"            trunk.sub_ports \u003d list(current_subports.values())"},{"line_number":179,"context_line":"            if removed_subports:"},{"line_number":180,"context_line":"                registry.notify("},{"line_number":181,"context_line":"                    constants.SUBPORTS, events.AFTER_DELETE, removed_subports)"},{"line_number":182,"context_line":"            return trunk"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_6a3b449d","line":179,"in_reply_to":"1aa78d24_6047184c","updated":"2016-07-08 18:39:29.000000000","message":"why not use trunk.subports?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"}],"neutron/tests/unit/services/trunk/test_plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3f93b9ebf6cd1c13941f3a5a1b19be4e2acb098","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                              self.trunk_plugin.delete_trunk,"},{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_c0e7ec44","line":59,"updated":"2016-07-07 23:59:09.000000000","message":"any specific reason why you mock the validator?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"dd36a81ae7e797a36f21f408db317ab19ffcaa4a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                              self.trunk_plugin.delete_trunk,"},{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_1b25b5c1","line":59,"in_reply_to":"1aa78d24_c0e7ec44","updated":"2016-07-08 18:21:42.000000000","message":"I chose to mock the validator to avoid having to call TrunkPlugin.add_segmentation_type() but could just pass it a lambda that returns True instead.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d3f93b9ebf6cd1c13941f3a5a1b19be4e2acb098","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"},{"line_number":63,"context_line":"        with self.port() as parent_port, self.port() as child_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_60b55830","line":60,"updated":"2016-07-07 23:59:09.000000000","message":"have you considered registering a real callback and see if you receive the right calls, that might require less mocking?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"6b3ec32a56db55702bf021edb3f7298b03c4bb42","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"},{"line_number":63,"context_line":"        with self.port() as parent_port, self.port() as child_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_742a03e9","line":60,"in_reply_to":"1aa78d24_4d2f82a1","updated":"2016-07-08 21:18:46.000000000","message":"Each testcase should get its own copy of the registry so we should be good. As for concurrency issues, as Ryan noted, currently the notify call is blocking and even if we switched to using a Greenpile we\u0027d still join all all callbacks completion.\n\nI can\u0027t see any contention issue, but I have been proven wrong in the past :)\n\nIf you feel more comfortable with the mocking, feel free to go ahead.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"de492aa2039d34381b99ecb58ec749969b8f64c5","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"},{"line_number":63,"context_line":"        with self.port() as parent_port, self.port() as child_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_e2e1279c","line":60,"in_reply_to":"1aa78d24_60b55830","updated":"2016-07-08 15:55:46.000000000","message":"I pointed out some places in the L3 plugin tests where we assert certain notifications are emitted. Asserting the handler is invoked is just as good and does require less mocking.\n\n@Armando I vaguely remember attempting the same sort of thing you\u0027re suggesting with BGP notifications and my tests were a little fragile because of a race between the handler being invoked and the assertion in the test. If the assertion wins the race, the test loses :) Is there a way to ensure the callbacks framework invokes the handler before the assertion is hit?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"aa108a695063bbe712392843bee72f6c6418fbad","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"},{"line_number":63,"context_line":"        with self.port() as parent_port, self.port() as child_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_4d2f82a1","line":60,"in_reply_to":"1aa78d24_96817c50","updated":"2016-07-08 19:25:56.000000000","message":"Never mind, it does look like registry.notify() is indeed a blocking call. No concurrency issues to be aware of. My memory is faulty, nothing to see here. Carry on with registering a real callback.","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"dd36a81ae7e797a36f21f408db317ab19ffcaa4a","unresolved":false,"context_lines":[{"line_number":57,"context_line":"                              self.context, trunk[\u0027id\u0027])"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    @mock.patch.object(rules.SubPortsValidator, \u0027validate\u0027)"},{"line_number":60,"context_line":"    @mock.patch.object(registry, \u0027notify\u0027)"},{"line_number":61,"context_line":"    def test_add_subports_notify("},{"line_number":62,"context_line":"            self, mock_notify, mock_validator):"},{"line_number":63,"context_line":"        with self.port() as parent_port, self.port() as child_port:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_96817c50","line":60,"in_reply_to":"1aa78d24_e2e1279c","updated":"2016-07-08 18:21:42.000000000","message":"I will try registering a real callback and asserting that it was called in the next PS.\n\nMy assumption was that the callbacks would be executed before the assertion is executed. Are there some concurrency aspects involved that I\u0027m missing?","commit_id":"284711864ed75a2a120ef22b0169d0525ba3f758"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d31cc08e37a0f1fd2b1724452aaa6793ecb245f8","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            self.trunk_plugin.create_trunk(self.context, {\u0027trunk\u0027: trunk}))"},{"line_number":41,"context_line":"        return response"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _create_subport_dict(port_id):"},{"line_number":45,"context_line":"        return {\u0027segmentation_type\u0027: \u0027vlan\u0027,"},{"line_number":46,"context_line":"                \u0027segmentation_id\u0027: 123,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_b4c90baf","line":43,"updated":"2016-07-08 21:19:20.000000000","message":"might as well be module functions, I don\u0027t see the point of using a staticmethod definition, do you?","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1bfdbd9b48cfeaeac413d84bc530127687bceac1","unresolved":false,"context_lines":[{"line_number":40,"context_line":"            self.trunk_plugin.create_trunk(self.context, {\u0027trunk\u0027: trunk}))"},{"line_number":41,"context_line":"        return response"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    @staticmethod"},{"line_number":44,"context_line":"    def _create_subport_dict(port_id):"},{"line_number":45,"context_line":"        return {\u0027segmentation_type\u0027: \u0027vlan\u0027,"},{"line_number":46,"context_line":"                \u0027segmentation_id\u0027: 123,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_2fc4a63e","line":43,"in_reply_to":"1aa78d24_b4c90baf","updated":"2016-07-08 21:53:02.000000000","message":"Done","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d31cc08e37a0f1fd2b1724452aaa6793ecb245f8","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                \u0027segmentation_id\u0027: 123,"},{"line_number":47,"context_line":"                \u0027port_id\u0027: port_id}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @staticmethod"},{"line_number":50,"context_line":"    def _register_mock_callback(resource, event):"},{"line_number":51,"context_line":"        callback \u003d mock.Mock()"},{"line_number":52,"context_line":"        registry.subscribe(callback, resource, event)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_d4c0177f","line":49,"updated":"2016-07-08 21:19:20.000000000","message":"ditto","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1bfdbd9b48cfeaeac413d84bc530127687bceac1","unresolved":false,"context_lines":[{"line_number":46,"context_line":"                \u0027segmentation_id\u0027: 123,"},{"line_number":47,"context_line":"                \u0027port_id\u0027: port_id}"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @staticmethod"},{"line_number":50,"context_line":"    def _register_mock_callback(resource, event):"},{"line_number":51,"context_line":"        callback \u003d mock.Mock()"},{"line_number":52,"context_line":"        registry.subscribe(callback, resource, event)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_0fc1ea2e","line":49,"in_reply_to":"1aa78d24_d4c0177f","updated":"2016-07-08 21:53:02.000000000","message":"Done","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d31cc08e37a0f1fd2b1724452aaa6793ecb245f8","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_add_subports_notify(self):"},{"line_number":71,"context_line":"        with self.port() as parent_port, self.port() as child_port:"},{"line_number":72,"context_line":"            self.trunk_plugin.add_segmentation_type(\u0027vlan\u0027, lambda x: True)"},{"line_number":73,"context_line":"            trunk \u003d self._create_test_trunk(parent_port)"},{"line_number":74,"context_line":"            subport \u003d self._create_subport_dict(child_port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":75,"context_line":"            callback \u003d self._register_mock_callback(constants.SUBPORTS,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_1400dfa9","line":72,"updated":"2016-07-08 21:19:20.000000000","message":"might as well move it in setUp()","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1bfdbd9b48cfeaeac413d84bc530127687bceac1","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def test_add_subports_notify(self):"},{"line_number":71,"context_line":"        with self.port() as parent_port, self.port() as child_port:"},{"line_number":72,"context_line":"            self.trunk_plugin.add_segmentation_type(\u0027vlan\u0027, lambda x: True)"},{"line_number":73,"context_line":"            trunk \u003d self._create_test_trunk(parent_port)"},{"line_number":74,"context_line":"            subport \u003d self._create_subport_dict(child_port[\u0027port\u0027][\u0027id\u0027])"},{"line_number":75,"context_line":"            callback \u003d self._register_mock_callback(constants.SUBPORTS,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_4fe132d0","line":72,"in_reply_to":"1aa78d24_1400dfa9","updated":"2016-07-08 21:53:02.000000000","message":"Done","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"d31cc08e37a0f1fd2b1724452aaa6793ecb245f8","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":94,"context_line":"            callback.assert_called_once_with("},{"line_number":95,"context_line":"                constants.SUBPORTS, events.AFTER_DELETE, self.trunk_plugin,"},{"line_number":96,"context_line":"                removed_subports\u003d[subport_obj])"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_5493874f","line":96,"updated":"2016-07-08 21:19:20.000000000","message":"this is wildly a clone of the previous method if not for AFTER_DELETE and the **kwargs and remove_subports. Could be worth to save yourself the trouble of copying and pasting.","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"1bfdbd9b48cfeaeac413d84bc530127687bceac1","unresolved":false,"context_lines":[{"line_number":93,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":94,"context_line":"            callback.assert_called_once_with("},{"line_number":95,"context_line":"                constants.SUBPORTS, events.AFTER_DELETE, self.trunk_plugin,"},{"line_number":96,"context_line":"                removed_subports\u003d[subport_obj])"}],"source_content_type":"text/x-python","patch_set":2,"id":"1aa78d24_8feb1ab0","line":96,"in_reply_to":"1aa78d24_5493874f","updated":"2016-07-08 21:53:02.000000000","message":"Done","commit_id":"274b6dedc8c8a6267eb6b0c9f17605652c5deb9a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b1fd4dc02ad4579c8eed1dbdf8c7c73805c13b1f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, self.trunk_plugin,"},{"line_number":85,"context_line":"                added_subports\u003d[subport_obj])"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":88,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":89,"context_line":"            delete_callback.assert_called_once_with("},{"line_number":90,"context_line":"                constants.SUBPORTS, events.AFTER_DELETE, self.trunk_plugin,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_2f582656","line":87,"updated":"2016-07-08 22:03:18.000000000","message":"these should be two separate test cases, because the asserts are not related. A failure on 83 would prevent the assert on 89 to be performed.","commit_id":"50cafd97b548b9ad640794babfc239f5bcffebc8"},{"author":{"_account_id":16800,"name":"Rawlin Peters","email":"rawlin.peters@hpe.com","username":"rawlin"},"change_message_id":"3398ffded3b5f08ba01f664270831400e5a3ae77","unresolved":false,"context_lines":[{"line_number":84,"context_line":"                constants.SUBPORTS, events.AFTER_CREATE, self.trunk_plugin,"},{"line_number":85,"context_line":"                added_subports\u003d[subport_obj])"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"            self.trunk_plugin.remove_subports("},{"line_number":88,"context_line":"                self.context, trunk[\u0027id\u0027], [subport])"},{"line_number":89,"context_line":"            delete_callback.assert_called_once_with("},{"line_number":90,"context_line":"                constants.SUBPORTS, events.AFTER_DELETE, self.trunk_plugin,"}],"source_content_type":"text/x-python","patch_set":3,"id":"1aa78d24_4668fc21","line":87,"in_reply_to":"1aa78d24_2f582656","updated":"2016-07-08 23:05:59.000000000","message":"Done","commit_id":"50cafd97b548b9ad640794babfc239f5bcffebc8"}]}
