)]}'
{"neutron/plugins/ml2/db.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"3aa0797e29619b9a9207acc41ca9700ddff9c222","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_ef8f7e2b","line":336,"range":{"start_line":336,"start_character":44,"end_line":336,"end_character":56},"updated":"2018-09-18 13:29:09.000000000","message":"The default value of \u0027payload\u0027 is None. If the default value is used, L.338 will fail. Shouldn\u0027t we avoid \u0027None\" as default if we always assume a payload object?","commit_id":"4a165c90180e8c40147f6347940688cf7116a5b2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"c029d9a3236c3be94b2eefd3611ef2a1e39cf93f","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_b4cf4053","line":336,"range":{"start_line":336,"start_character":44,"end_line":336,"end_character":56},"in_reply_to":"3f79a3b5_e3ac75ef","updated":"2018-10-30 11:22:28.000000000","message":"but shouldn\u0027t we add something like:\n\n    if not payload:\n        return\n\nto avoid exception raise in L338?","commit_id":"4a165c90180e8c40147f6347940688cf7116a5b2"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"a0913d5b8d80775c96cf586bfb1ff40b50e52e92","unresolved":false,"context_lines":[{"line_number":333,"context_line":""},{"line_number":334,"context_line":""},{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e3ac75ef","line":336,"range":{"start_line":336,"start_character":44,"end_line":336,"end_character":56},"in_reply_to":"3f79a3b5_ef8f7e2b","updated":"2018-09-18 15:52:26.000000000","message":"We\u0027ve discussed this a few times before, but it\u0027s worth another round of discussion.\n\n\nHistorically speaking, I think we wanted to use payload as kwarg to:\n- Allow us to reuse the existing plumbing in callbacks [1] thereby reusing the notify loop in the callback manager.\n- Allow more flexibility/interop with the existing callback signatures. Having payload as a kwarg doesn\u0027t require a new callback method as we adopt the new signatures, but instead can look for the payload kwarg. For example see [2] that can be called from either the new payload style callback or the old school style.\n- Support callbacks that don\u0027t need to pass payloads [3].\n\n\nThat said I do agree that there\u0027s no need for kwargs with the payload style, but the original idea was to get everyone onto the new payload callbacks, then revise again to remove it [4].\n\n\nAt this point I feel like we\u0027re already in the rabbit hole of using payload as kwarg; we have code that expects it as such (ex [2]). My vote would be to finish up the payload work and then revise again to make it an arg. Also note that consumers need to already make assumptions about the payload; like what values have been populated. These are really semantics left up to the event publisher, but should be consistent for each event resource/type across all publishers.\n\n\n[1] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/callbacks/manager.py#L184\n[2] https://github.com/openstack/neutron/blob/master/neutron/db/securitygroups_db.py#L54\n[3] https://github.com/openstack/neutron/blob/master/neutron/service.py#L92\n[4] https://review.openstack.org/#/c/346554/13/neutron_lib/callbacks/manager.py@166","commit_id":"4a165c90180e8c40147f6347940688cf7116a5b2"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"054459c2f9eeb848b5ca327d3585ed3645ccfe4a","unresolved":false,"context_lines":[{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"},{"line_number":340,"context_line":"        return"},{"line_number":341,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_8b46e87d","line":338,"updated":"2018-11-08 09:38:52.000000000","message":"I will repeat my question from previous PS here:\n\nshouldn\u0027t You add something like:\n    if not payload:\n        return\nto avoid raising here AttributeError in case if payload would be None?","commit_id":"14485906e950aa53e2d2b1a9661be2e772fc345f"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"e28c52e7f978840089b1ea4c75f201ce4558139e","unresolved":false,"context_lines":[{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"},{"line_number":340,"context_line":"        return"},{"line_number":341,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_939cc4be","line":338,"in_reply_to":"3f79a3b5_298b1217","updated":"2018-11-09 08:09:22.000000000","message":"Ok, thx for explanation. If it\u0027s like that in other places also then it\u0027s fine for me.","commit_id":"14485906e950aa53e2d2b1a9661be2e772fc345f"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"05b62459ff9fe30485e721e2794123f0a286fdb1","unresolved":false,"context_lines":[{"line_number":335,"context_line":"def _prevent_segment_delete_with_port_bound(resource, event, trigger,"},{"line_number":336,"context_line":"                                            payload\u003dNone):"},{"line_number":337,"context_line":"    \"\"\"Raise exception if there are any ports bound with segment_id.\"\"\""},{"line_number":338,"context_line":"    if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":339,"context_line":"        # don\u0027t check for network deletes"},{"line_number":340,"context_line":"        return"},{"line_number":341,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_298b1217","line":338,"in_reply_to":"3f79a3b5_8b46e87d","updated":"2018-11-08 17:21:34.000000000","message":"I thought I answered it as part of my response in PS3 with \"Also note that consumers need to already make assumptions about the payload; like what values have been populated. These are really semantics left up to the event publisher, but should be consistent for each event resource/type across all publishers.\"... \n\n\nSo IMO we don\u0027t need to check if its null as we are making assumptions (for now) that it\u0027s there. If a publisher is not including the payload and its expected; this a programming error. This is the way we\u0027ve been doing things for a while now so if we do want to change this, it\u0027s going to need to be propagated to all the places we\u0027ve already updated the code and assumed payload is there.","commit_id":"14485906e950aa53e2d2b1a9661be2e772fc345f"}],"neutron/services/segments/plugin.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"665426fc8dd6a9328311e4a250ce78bd6b5957ad","unresolved":false,"context_lines":[{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    @registry.receives(resources.SEGMENT, [events.BEFORE_DELETE])"},{"line_number":112,"context_line":"    def _prevent_segment_delete_with_subnet_associated("},{"line_number":113,"context_line":"            self, resource, event, trigger, payload\u003dNone):"},{"line_number":114,"context_line":"        \"\"\"Raise exception if there are any subnets associated with segment.\"\"\""},{"line_number":115,"context_line":"        if payload.metadata.get(\u0027for_net_delete\u0027):"},{"line_number":116,"context_line":"            # don\u0027t check if this is a part of a network delete operation"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_0f7e7a1a","line":113,"range":{"start_line":113,"start_character":44,"end_line":113,"end_character":56},"updated":"2018-09-18 13:30:08.000000000","message":"Same comment as for neutron/plugins/ml2/db.py","commit_id":"4a165c90180e8c40147f6347940688cf7116a5b2"}]}
