)]}'
{"neutron/plugins/cisco/models/virt_phy_sw_v2.py":[{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"c5abc7556892f126fa3cf97b6d722592e0ac526b","unresolved":false,"context_lines":[{"line_number":523,"context_line":""},{"line_number":524,"context_line":"        This method is included here to satisfy abstract method requirements."},{"line_number":525,"context_line":"        \"\"\""},{"line_number":526,"context_line":"        pass  # pragma no cover"},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    def update_subnet(self, context, id, subnet):"},{"line_number":529,"context_line":"        \"\"\"Update subnet. This method is delegated to the vswitch plugin."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2B31c%3D","line":526,"updated":"2014-01-21 08:36:34.000000000","message":"nice thanks, i didn\u0027t know this\nhttp://nedbatchelder.com/code/coverage/excluding.html","commit_id":"000d9ecaa5793229de7b0e663379af4e3fdfdf64"}],"neutron/tests/unit/cisco/test_network_plugin.py":[{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"39f1a3e88d791aa798c8f1cb4fe3d5c4f1d1ee8e","unresolved":false,"context_lines":[{"line_number":820,"context_line":"                    (provider.SEGMENTATION_ID, 1234)]"},{"line_number":821,"context_line":"        for k, v in expected:"},{"line_number":822,"context_line":"            self.assertEqual(network[k], v)"},{"line_number":823,"context_line":"        self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":824,"context_line":"        req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":825,"context_line":"        req.get_response(self.api)"},{"line_number":826,"context_line":"        self.assertFalse(network_db_v2.is_provider_network(network_id))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Bf8A%3D","line":823,"updated":"2013-11-25 13:31:58.000000000","message":"If this assert fails, and the delete request is not invoked (or if the delete fails), will the created network be cleaned up?","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"0e07b9333dedec4559778939aeb11372fed031eb","unresolved":false,"context_lines":[{"line_number":820,"context_line":"                    (provider.SEGMENTATION_ID, 1234)]"},{"line_number":821,"context_line":"        for k, v in expected:"},{"line_number":822,"context_line":"            self.assertEqual(network[k], v)"},{"line_number":823,"context_line":"        self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":824,"context_line":"        req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":825,"context_line":"        req.get_response(self.api)"},{"line_number":826,"context_line":"        self.assertFalse(network_db_v2.is_provider_network(network_id))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BecQ%3D","line":823,"in_reply_to":"AAAATn%2F%2Bf8A%3D","updated":"2013-11-25 17:28:42.000000000","message":"Good point. I think the neutron db base test code would eventually clean up before the next test case, but I prefer having the test cases clean up as much as possible.","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e61e4c6b54c92e41ab2274556dabcd65fa449424","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BZ2s%3D","line":827,"updated":"2013-11-26 13:51:10.000000000","message":"deletion should be done in a tearDown function, instead of via a finally block.","commit_id":"95ee044b20a2e525f6e8ecb039c87787e2645b37"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"c0ea274d18a07687adfdc68dd21f749a43c43f1b","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BZF8%3D","line":827,"in_reply_to":"AAAATn%2F%2BZ2s%3D","updated":"2013-11-26 16:02:18.000000000","message":"Why? The network delete is a part of this test case, that is, it\u0027s checking that this network is correctly removed from the provider network database upon network delete.","commit_id":"95ee044b20a2e525f6e8ecb039c87787e2645b37"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"57f2105ab17ac1c47f092e0607e93afdf7cff585","unresolved":false,"context_lines":[{"line_number":819,"context_line":"                        (provider.NETWORK_TYPE, \u0027vlan\u0027),"},{"line_number":820,"context_line":"                        (provider.PHYSICAL_NETWORK, PHYS_NET),"},{"line_number":821,"context_line":"                        (provider.SEGMENTATION_ID, 1234)]"},{"line_number":822,"context_line":"            create_confirmed \u003d False"},{"line_number":823,"context_line":"            for k, v in expected:"},{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BF%2B8%3D","line":822,"updated":"2013-12-02 17:24:17.000000000","message":"Lines 815 and 821 are simple assignments. They can never raise an exception, so they should not be inside the try.","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"c37fa16c86de8571311643c7c5bc352bc8f7e0b7","unresolved":false,"context_lines":[{"line_number":819,"context_line":"                        (provider.NETWORK_TYPE, \u0027vlan\u0027),"},{"line_number":820,"context_line":"                        (provider.PHYSICAL_NETWORK, PHYS_NET),"},{"line_number":821,"context_line":"                        (provider.SEGMENTATION_ID, 1234)]"},{"line_number":822,"context_line":"            create_confirmed \u003d False"},{"line_number":823,"context_line":"            for k, v in expected:"},{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F99rk%3D","line":822,"in_reply_to":"AAAATn%2F%2BF%2B8%3D","updated":"2013-12-03 23:27:29.000000000","message":"Done","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"0bda4e99efb83e851166c88c887ef01a7de7afbe","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BYrY%3D","line":827,"updated":"2013-11-26 16:44:49.000000000","message":"In response to your reply in rev 3: Because it is intermixing testing with test cleanup, which should be in tearDown(). It can become ambiguous as to whether the logic in the finally block is cleaning up due to a failed create, or exercising more due to a successful create. Especially, if more logic is added to the block later.\nTypically one would do a create and then a delete, and would use the teardown to ensure that any create is cleaned up","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"c37fa16c86de8571311643c7c5bc352bc8f7e0b7","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F99rs%3D","line":827,"in_reply_to":"AAAATn%2F%2BF5o%3D","updated":"2013-12-03 23:27:29.000000000","message":"I don\u0027t think that using try-else-finally helps here. There are a few complications with the suggested approach: (a) The \u0027else:\u0027 syntax isn\u0027t allowed unless there are preceding except clauses. (b) The get_response is part of the delete... the delete isn\u0027t triggered until get_response is called. So \u0027assert not provider net\u0027 would always assert in the snippet above.\n\nMaybe this is what you had in mind?:\n\ntry:\n    # assert expected values\n    # assert provider net\nexcept:\n    # delete / get response\nelse:\n    # delete / get response\n    # assert not provider net\n\nThis eliminates the boolean, but requires 2 copies of delete (there\u0027s no finally to combine happy/non-happy cleanup), which to me is less palatable than the boolean.\n\nI had thought that the boolean was an inexpensive way to improve test performance (provider network only created once), but I\u0027ll split this into 2 separate tests to eliminate the boolean.","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"57f2105ab17ac1c47f092e0607e93afdf7cff585","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BF5o%3D","line":827,"in_reply_to":"AAAATn%2F%2BX7k%3D","updated":"2013-12-02 17:24:17.000000000","message":"I can see that this is part of the test, but instead of the flag maybe you can make sure of try-else-finally?\n\n    try:\n        # assert expected values\n        # assert provider net\n    else:\n         # assert not provider net\n    finally:\n        # get response","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e8861db6791ae2affcad43491808a655dccfb3af","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BX7k%3D","line":827,"in_reply_to":"AAAATn%2F%2BYmc%3D","updated":"2013-11-26 19:24:14.000000000","message":"Ideally, the setup and teardown code should handle the test setup, and the test should then exercise one condition. In practice, either/both of those are not always possible, but should be a goal, IMO (for example, one can use multiple classes to put common cleanup/setup that applies to all test cases in each class).\n\nI\u0027m just highlighting here that the finally block is dual purpose, doing additional happy path testing for the success case, and doing cleanup for failure conditions. It is much better, IMO, to try to strive to keep cleanup out of the test case body.","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"360d74495f92fa3319114e7d46c4e969e22f784d","unresolved":false,"context_lines":[{"line_number":824,"context_line":"                self.assertEqual(network[k], v)"},{"line_number":825,"context_line":"            self.assertTrue(network_db_v2.is_provider_network(network_id))"},{"line_number":826,"context_line":"            create_confirmed \u003d True"},{"line_number":827,"context_line":"        finally:"},{"line_number":828,"context_line":"            req \u003d self.new_delete_request(\u0027networks\u0027, network_id)"},{"line_number":829,"context_line":"            req.get_response(self.api)"},{"line_number":830,"context_line":"            if create_confirmed:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2BYmc%3D","line":827,"in_reply_to":"AAAATn%2F%2BYrY%3D","updated":"2013-11-26 18:05:09.000000000","message":"The tearDown() method is shared by all test cases in a given class. Based on what you\u0027re suggesting, the tearDown() method should be modified so that it covers all possible cleanup for all possible test cases within a class. I don\u0027t see that this is always practical or efficient. Wherever practical, I prefer the model whereby each individual test case knows what it\u0027s setting up, so it should do its best to clean up after itself, whether it\u0027s cleanup for a successful  or failing test run. In this particular case, we have code which is doing the network delete, so why not use this for both successful or failing scenarios? If you look through the Neutron unit test code base, there are many other instances where try/finally blocks are being used to guarantee cleanup of network/subnet/port resources, regardless of whether it\u0027s being done for a successful test run or for a failure/exception.","commit_id":"17601635abb2ef0f38bf3b78ed9b171b9817b526"},{"author":{"_account_id":8449,"name":"Marios Andreou","email":"marios.andreou@gmail.com","username":"marios"},"change_message_id":"c5abc7556892f126fa3cf97b6d722592e0ac526b","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2013 Cisco Systems, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2B30U%3D","line":1,"updated":"2014-01-21 08:36:34.000000000","message":"IANAL but this just looks odd to me, shouldn\u0027t you keep the original and just add to it?","commit_id":"000d9ecaa5793229de7b0e663379af4e3fdfdf64"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"2a2544b8bd5fedbbe42bb988c8c3bc7c6b37351c","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2013 Cisco Systems, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2BrQ4%3D","line":1,"in_reply_to":"AAAAUH%2F%2B30U%3D","updated":"2014-02-19 21:00:04.000000000","message":"Agreed the original must be preserved for now.","commit_id":"000d9ecaa5793229de7b0e663379af4e3fdfdf64"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"38c7a7f65f2a2c25cc63145ceeda46e2cc4546ea","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2013 Cisco Systems, Inc."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2BqrE%3D","line":1,"in_reply_to":"AAAAUX%2F%2BrQ4%3D","updated":"2014-02-19 22:12:24.000000000","message":"Done","commit_id":"000d9ecaa5793229de7b0e663379af4e3fdfdf64"}],"neutron/tests/unit/cisco/test_plugin_model.py":[{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"cf48e944c2b9bc08ed847293b0439e032e5377ec","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2012 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BhU0%3D","line":1,"updated":"2013-11-25 07:20:15.000000000","message":"2013","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"0e07b9333dedec4559778939aeb11372fed031eb","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2012 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Be8g%3D","line":1,"in_reply_to":"AAAATn%2F%2BhU0%3D","updated":"2013-11-25 17:28:42.000000000","message":"Wow, time flies. Fixed.","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"cf48e944c2b9bc08ed847293b0439e032e5377ec","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":"import sys"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.common import config"},{"line_number":20,"context_line":"from neutron import context"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BhUo%3D","line":17,"updated":"2013-11-25 07:20:15.000000000","message":"sys is stdlib so should be a separate import section","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"0e07b9333dedec4559778939aeb11372fed031eb","unresolved":false,"context_lines":[{"line_number":14,"context_line":"# limitations under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":"import sys"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from neutron.common import config"},{"line_number":20,"context_line":"from neutron import context"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2Be8c%3D","line":17,"in_reply_to":"AAAATn%2F%2BhUo%3D","updated":"2013-11-25 17:28:42.000000000","message":"Done","commit_id":"866fb6943e9eab63aab8e3cd5152b873ea00a92b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"e61e4c6b54c92e41ab2274556dabcd65fa449424","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BZ2I%3D","line":1,"updated":"2013-11-26 13:51:10.000000000","message":"Shouldn\u0027t copyright be Cisco?","commit_id":"95ee044b20a2e525f6e8ecb039c87787e2645b37"},{"author":{"_account_id":6695,"name":"Dane LeBlanc","email":"leblancd@cisco.com","username":"leblancd"},"change_message_id":"3f10f730fc215ab6e7cf5bf544443dfb99886058","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2013 OpenStack Foundation."},{"line_number":2,"context_line":"#"},{"line_number":3,"context_line":"# Licensed under the Apache License, Version 2.0 (the \"License\");"},{"line_number":4,"context_line":"# you may not use this file except in compliance with the License."}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2BY7Q%3D","line":1,"in_reply_to":"AAAATn%2F%2BZ2I%3D","updated":"2013-11-26 16:06:30.000000000","message":"Done","commit_id":"95ee044b20a2e525f6e8ecb039c87787e2645b37"}]}
