)]}'
{"neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e54264ede8cee5df5351118201f4e2adaef51530","unresolved":false,"context_lines":[{"line_number":353,"context_line":"                                              **args)"},{"line_number":354,"context_line":"                if mtu:"},{"line_number":355,"context_line":"                    int_vxlan.link.set_mtu(mtu)"},{"line_number":356,"context_line":"            except NetlinkError:"},{"line_number":357,"context_line":"                with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":358,"context_line":"                    if ctxt.value.code \u003d\u003d errno.EINVAL:"},{"line_number":359,"context_line":"                        phys_dev_mtu \u003d ip_lib.get_device_mtu(self.local_int)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_e84204ab","line":356,"updated":"2018-04-23 20:57:54.000000000","message":"So this is only for catching where L355 fails, right?  Is it better to nest a try/except, or maybe move L354-370 into it\u0027s own try/except below this one?\n\nAlso, this looks like the first time we have exposed a pyroute2 exception outside of ip_lib.  Is it better to define our own exception like we do for NetworkInterfaceNotFound() ?","commit_id":"f62a5f163363922aa5a1963fbc04e18365641a54"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"25623942de4c24cf86518457c2aba59e2a53da91","unresolved":false,"context_lines":[{"line_number":353,"context_line":"                                              **args)"},{"line_number":354,"context_line":"                if mtu:"},{"line_number":355,"context_line":"                    int_vxlan.link.set_mtu(mtu)"},{"line_number":356,"context_line":"            except NetlinkError:"},{"line_number":357,"context_line":"                with excutils.save_and_reraise_exception() as ctxt:"},{"line_number":358,"context_line":"                    if ctxt.value.code \u003d\u003d errno.EINVAL:"},{"line_number":359,"context_line":"                        phys_dev_mtu \u003d ip_lib.get_device_mtu(self.local_int)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_d8a02493","line":356,"in_reply_to":"9f6a8fd7_e84204ab","updated":"2018-04-24 10:16:47.000000000","message":"right, moved to separate try...except... block\nI also added different exception type which will be catch here","commit_id":"f62a5f163363922aa5a1963fbc04e18365641a54"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e54264ede8cee5df5351118201f4e2adaef51530","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                                   \u0027segmentation_id\u0027: segmentation_id,"},{"line_number":367,"context_line":"                                   \u0027dev\u0027: self.local_int,"},{"line_number":368,"context_line":"                                   \u0027phys_mtu\u0027: phys_dev_mtu})"},{"line_number":369,"context_line":"                        int_vxlan.link.delete()"},{"line_number":370,"context_line":"                        return None"},{"line_number":371,"context_line":"            except RuntimeError:"},{"line_number":372,"context_line":"                with excutils.save_and_reraise_exception() as ctxt:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_a81accc8","line":369,"updated":"2018-04-23 20:57:54.000000000","message":"This is why I made the other comment - if we got here from L352 then there is no interface to delete.","commit_id":"f62a5f163363922aa5a1963fbc04e18365641a54"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"25623942de4c24cf86518457c2aba59e2a53da91","unresolved":false,"context_lines":[{"line_number":366,"context_line":"                                   \u0027segmentation_id\u0027: segmentation_id,"},{"line_number":367,"context_line":"                                   \u0027dev\u0027: self.local_int,"},{"line_number":368,"context_line":"                                   \u0027phys_mtu\u0027: phys_dev_mtu})"},{"line_number":369,"context_line":"                        int_vxlan.link.delete()"},{"line_number":370,"context_line":"                        return None"},{"line_number":371,"context_line":"            except RuntimeError:"},{"line_number":372,"context_line":"                with excutils.save_and_reraise_exception() as ctxt:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f6a8fd7_fbcf2226","line":369,"in_reply_to":"9f6a8fd7_a81accc8","updated":"2018-04-24 10:16:47.000000000","message":"Yes, it might happen probably in some specific case :)","commit_id":"f62a5f163363922aa5a1963fbc04e18365641a54"}],"neutron/tests/unit/plugins/ml2/drivers/linuxbridge/agent/test_linuxbridge_neutron_agent.py":[{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0d315bdbb78543a34e7160d10e40dc9ccffec925","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                                dstport\u003dNone,"},{"line_number":469,"context_line":"                                                ttl\u003dNone,"},{"line_number":470,"context_line":"                                                dev\u003dself.lbm.local_int)"},{"line_number":471,"context_line":"                delete_dev.assert_called_once_with()"},{"line_number":472,"context_line":"                dv6_fn.assert_not_called()"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def test__update_interface_ip_details(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f6a8fd7_0cc3958a","line":471,"updated":"2018-04-25 21:03:26.000000000","message":"assert_called_once() ?","commit_id":"60d62d310373a65a362a4bdeb183dcb37511d360"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4f6692e4799866cb56b346fa5e023769445baeca","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                                dstport\u003dNone,"},{"line_number":469,"context_line":"                                                ttl\u003dNone,"},{"line_number":470,"context_line":"                                                dev\u003dself.lbm.local_int)"},{"line_number":471,"context_line":"                delete_dev.assert_called_once_with()"},{"line_number":472,"context_line":"                dv6_fn.assert_not_called()"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def test__update_interface_ip_details(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f6a8fd7_8cf56559","line":471,"in_reply_to":"9f6a8fd7_0cc3958a","updated":"2018-04-25 21:35:46.000000000","message":"I think that assert_called_once() is not valid method, please check e.g. http://engineroom.trackmaven.com/blog/mocking-mistakes/\nThere is also check about it in Neutron repo: https://github.com/openstack/neutron/blob/master/neutron/hacking/checks.py#L55","commit_id":"60d62d310373a65a362a4bdeb183dcb37511d360"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"f9fb13ba8a706e012b5050b8147ba0c3804bfedf","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                                dstport\u003dNone,"},{"line_number":469,"context_line":"                                                ttl\u003dNone,"},{"line_number":470,"context_line":"                                                dev\u003dself.lbm.local_int)"},{"line_number":471,"context_line":"                delete_dev.assert_called_once_with()"},{"line_number":472,"context_line":"                dv6_fn.assert_not_called()"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def test__update_interface_ip_details(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f6a8fd7_4c0c1b3b","line":471,"in_reply_to":"9f6a8fd7_5138343c","updated":"2018-04-26 14:56:41.000000000","message":"Not exactly, this will check if \"delete_dev\" was called exactly with no arguments, call_count will check only if it was called once. See:\n\n\u003e\u003e\u003e import mock\n\u003e\u003e\u003e m \u003d mock.Mock()\n\u003e\u003e\u003e m(1, 2, 3)\n\u003cMock name\u003d\u0027mock()\u0027 id\u003d\u0027140353807155408\u0027\u003e\n\u003e\u003e\u003e m.assert_called_once_with()\nTraceback (most recent call last):\n  File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n  File \"/home/skaplons/openstack-neutron/.tox/py27/lib/python2.7/site-packages/mock/mock.py\", line 948, in assert_called_once_with\n    return self.assert_called_with(*args, **kwargs)\n  File \"/home/skaplons/openstack-neutron/.tox/py27/lib/python2.7/site-packages/mock/mock.py\", line 937, in assert_called_with\n    six.raise_from(AssertionError(_error_message(cause)), cause)\n  File \"/home/skaplons/openstack-neutron/.tox/py27/lib/python2.7/site-packages/six.py\", line 718, in raise_from\n    raise value\nAssertionError: Expected call: mock()\nActual call: mock(1, 2, 3)\n\u003e\u003e\u003e m.call_count\n1\n\n\nbut of course, in case of this test both solutions would be good :)","commit_id":"60d62d310373a65a362a4bdeb183dcb37511d360"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"9e8244f0f6cdf51560afced464d01e856aed73ad","unresolved":false,"context_lines":[{"line_number":468,"context_line":"                                                dstport\u003dNone,"},{"line_number":469,"context_line":"                                                ttl\u003dNone,"},{"line_number":470,"context_line":"                                                dev\u003dself.lbm.local_int)"},{"line_number":471,"context_line":"                delete_dev.assert_called_once_with()"},{"line_number":472,"context_line":"                dv6_fn.assert_not_called()"},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"    def test__update_interface_ip_details(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f6a8fd7_5138343c","line":471,"in_reply_to":"9f6a8fd7_8cf56559","updated":"2018-04-26 14:45:56.000000000","message":"Well, I guess I learned something today, I thought even the mock page mentioned it.\n\nBut I guess it still seems strange to do this, perhaps checking the call count is better?\n\nself.assertEqual(1, delete_dev.call_count)\n\nBut then I see some of the Qos tests do it this way, in the end it is checking the same thing.","commit_id":"60d62d310373a65a362a4bdeb183dcb37511d360"}]}
