)]}'
{"dragonflow/neutron/plugin.py":[{"author":{"_account_id":7805,"name":"Li Ma","email":"skywalker.nick@gmail.com","username":"Nick"},"change_message_id":"8eaba4aad1cba9cbec22bd8c95f971c43039dea8","unresolved":false,"context_lines":[{"line_number":579,"context_line":"    @lock_db.wrap_db_lock()"},{"line_number":580,"context_line":"    def delete_port(self, context, port_id, l3_port_check\u003dTrue):"},{"line_number":581,"context_line":"        self._pre_delete_port(context, port_id, l3_port_check)"},{"line_number":582,"context_line":"        try:"},{"line_number":583,"context_line":"            port \u003d self.get_port(context, port_id)"},{"line_number":584,"context_line":"            topic \u003d port[\u0027tenant_id\u0027]"},{"line_number":585,"context_line":"        except n_exc.PortNotFound:"},{"line_number":586,"context_line":"            return"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":589,"context_line":"            self.disassociate_floatingips(context, port_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_ee18ac77","line":586,"range":{"start_line":582,"start_character":8,"end_line":586,"end_character":18},"updated":"2016-04-25 17:32:43.000000000","message":"Can we remove the try-except? If the port is not found in Neutron, we just raise the exception, telling the user that the port is not found. the \u0027return\u0027 here is not appropriate.\n\nBTW, in the _pre_delete_port, we get port but we don\u0027t return it.\nSo if we can return the port object from _pre_delete_port function, we can just remove them all.\n\nport \u003d self._pre_delete_port(...)\ntopic \u003d port[\u0027tenant_id\u0027]\n\nThat\u0027s all.","commit_id":"940e2baa3559337460cbf9b90dc34f9e4be30511"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"39d47d8783de77a722731097b7db2eabebab162b","unresolved":false,"context_lines":[{"line_number":579,"context_line":"    @lock_db.wrap_db_lock()"},{"line_number":580,"context_line":"    def delete_port(self, context, port_id, l3_port_check\u003dTrue):"},{"line_number":581,"context_line":"        self._pre_delete_port(context, port_id, l3_port_check)"},{"line_number":582,"context_line":"        try:"},{"line_number":583,"context_line":"            port \u003d self.get_port(context, port_id)"},{"line_number":584,"context_line":"            topic \u003d port[\u0027tenant_id\u0027]"},{"line_number":585,"context_line":"        except n_exc.PortNotFound:"},{"line_number":586,"context_line":"            return"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":589,"context_line":"            self.disassociate_floatingips(context, port_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_ab71ef46","line":586,"range":{"start_line":582,"start_character":8,"end_line":586,"end_character":18},"in_reply_to":"1a122d0e_2989f926","updated":"2016-05-01 19:25:46.000000000","message":"Perhaps the get_port can be moved out of _pre_delete_port. _pre_delete_port will be given the port (instead of context), and continue the logic from there including the test of l3_port_check?","commit_id":"940e2baa3559337460cbf9b90dc34f9e4be30511"},{"author":{"_account_id":20287,"name":"hujie","email":"mike.hu@huawei.com","username":"hujie"},"change_message_id":"32fec2ada8c051da31f8c639b711e41f5ebeddbf","unresolved":false,"context_lines":[{"line_number":579,"context_line":"    @lock_db.wrap_db_lock()"},{"line_number":580,"context_line":"    def delete_port(self, context, port_id, l3_port_check\u003dTrue):"},{"line_number":581,"context_line":"        self._pre_delete_port(context, port_id, l3_port_check)"},{"line_number":582,"context_line":"        try:"},{"line_number":583,"context_line":"            port \u003d self.get_port(context, port_id)"},{"line_number":584,"context_line":"            topic \u003d port[\u0027tenant_id\u0027]"},{"line_number":585,"context_line":"        except n_exc.PortNotFound:"},{"line_number":586,"context_line":"            return"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":589,"context_line":"            self.disassociate_floatingips(context, port_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1a122d0e_2989f926","line":586,"range":{"start_line":582,"start_character":8,"end_line":586,"end_character":18},"in_reply_to":"1a122d0e_ee18ac77","updated":"2016-04-26 01:55:29.000000000","message":"If we want to reuse the value returned by pre_delete_port, we have to judge three situations in delete_port, l3_port_check is False, return found port or return None, the try-except phase is similar with the phase in pre_delete_port, maybe both of the two places should be modified to raise a exception","commit_id":"940e2baa3559337460cbf9b90dc34f9e4be30511"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"d5446f7f08a02a4ec9a42942c6b18e8d477d0fbd","unresolved":false,"context_lines":[{"line_number":577,"context_line":"    def delete_port(self, context, port_id, l3_port_check\u003dTrue):"},{"line_number":578,"context_line":"        try:"},{"line_number":579,"context_line":"            port \u003d self.get_port(context, port_id)"},{"line_number":580,"context_line":"        except n_exc.PortNotFound:"},{"line_number":581,"context_line":"            raise n_exc.PortNotFound(port_id\u003dport_id)"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        self._pre_delete_port(port, l3_port_check)"},{"line_number":584,"context_line":"        topic \u003d port[\u0027tenant_id\u0027]"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_4f72c74a","line":581,"range":{"start_line":580,"start_character":0,"end_line":581,"end_character":53},"updated":"2016-05-03 07:00:50.000000000","message":"Why do you catch this exception only to re-raise it? Consider letting it propagate upwards automatically.","commit_id":"862fd51206fa71014abac8e54644c4455488acaa"}]}
