)]}'
{"neutron/plugins/openvswitch/agent/ovs_neutron_agent.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ff2a7d740f30048a54e5ed081496ec157bc1ebfb","unresolved":false,"context_lines":[{"line_number":893,"context_line":"                     {\u0027physical_network\u0027: physical_network,"},{"line_number":894,"context_line":"                      \u0027bridge\u0027: bridge})"},{"line_number":895,"context_line":"            # setup physical bridge"},{"line_number":896,"context_line":"            if bridge not in ovs_lib.get_bridges(self.root_helper):"},{"line_number":897,"context_line":"                LOG.error(_(\"Bridge %(bridge)s for physical network \""},{"line_number":898,"context_line":"                            \"%(physical_network)s does not exist. Agent \""},{"line_number":899,"context_line":"                            \"terminated!\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_0da93d25","line":896,"updated":"2014-06-24 16:17:56.000000000","message":"ovs_lib.get_bridges is called for every bridge. It could be called once before the for loop","commit_id":"bd15dfc1d9bb2864a2563e3e9eedcb4594123dd0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"3293982d74d129cafef82cf5af7c7f355d6c85be","unresolved":false,"context_lines":[{"line_number":893,"context_line":"                     {\u0027physical_network\u0027: physical_network,"},{"line_number":894,"context_line":"                      \u0027bridge\u0027: bridge})"},{"line_number":895,"context_line":"            # setup physical bridge"},{"line_number":896,"context_line":"            if bridge not in ovs_lib.get_bridges(self.root_helper):"},{"line_number":897,"context_line":"                LOG.error(_(\"Bridge %(bridge)s for physical network \""},{"line_number":898,"context_line":"                            \"%(physical_network)s does not exist. Agent \""},{"line_number":899,"context_line":"                            \"terminated!\"),"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_08a84bd8","line":896,"in_reply_to":"1ae5cdf2_0da93d25","updated":"2014-06-24 16:28:54.000000000","message":"yes this occurred to me too.\n\ni am still getting to grips with OpenStack\u0027s unit testing framework so i did want to make too many changes.\n\ni will refactor the change as you suggested","commit_id":"bd15dfc1d9bb2864a2563e3e9eedcb4594123dd0"}],"neutron/tests/unit/openvswitch/test_ovs_neutron_agent.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"ddd896e6c25d13254ff85022cdf164a410983974","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                       return_value\u003d\u002700:00:00:00:00:01\u0027),"},{"line_number":126,"context_line":"            mock.patch(\u0027neutron.agent.linux.ovs_lib.\u0027"},{"line_number":127,"context_line":"                       \u0027get_bridges\u0027,"},{"line_number":128,"context_line":"                       return_value\u003d\"br-eth\"),"},{"line_number":129,"context_line":"            mock.patch(\u0027neutron.openstack.common.loopingcall.\u0027"},{"line_number":130,"context_line":"                       \u0027FixedIntervalLoopingCall\u0027,"},{"line_number":131,"context_line":"                       new\u003dMockFixedIntervalLoopingCall),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_fe21d04f","line":128,"updated":"2014-06-26 07:31:37.000000000","message":"it should be list of strings not a string ?","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"65db3cd4022a26edb506fdbea4d5a20f450becd4","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                       return_value\u003d\u002700:00:00:00:00:01\u0027),"},{"line_number":126,"context_line":"            mock.patch(\u0027neutron.agent.linux.ovs_lib.\u0027"},{"line_number":127,"context_line":"                       \u0027get_bridges\u0027,"},{"line_number":128,"context_line":"                       return_value\u003d\"br-eth\"),"},{"line_number":129,"context_line":"            mock.patch(\u0027neutron.openstack.common.loopingcall.\u0027"},{"line_number":130,"context_line":"                       \u0027FixedIntervalLoopingCall\u0027,"},{"line_number":131,"context_line":"                       new\u003dMockFixedIntervalLoopingCall),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_320d2490","line":128,"in_reply_to":"1ae5cdf2_fe21d04f","updated":"2014-06-26 12:26:51.000000000","message":"mocking ovs.lib.get_bridges is required for ovs_neutron_agent.OVSNeutronAgent(**kwargs)\nto work in the test suite but specifying a return value is not.\nas such i will refactor this mock to \n\nmock.patch(\u0027neutron.agent.linux.ovs_lib.\u0027\n                       \u0027get_bridges\u0027),\n\n\"br-eth\" is required for test_setup_physical_bridges however upon further investigation setting that value here is not sufficient so i will as YAMAMOTO suggested below.","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"cba350976eaa66719985f12282e039f85d0da692","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":451,"context_line":"        with contextlib.nested("},{"line_number":452,"context_line":"            mock.patch.object(ip_lib, \"device_exists\"),"},{"line_number":453,"context_line":"            mock.patch.object(sys, \"exit\"),"},{"line_number":454,"context_line":"            mock.patch.object(utils, \"execute\"),"},{"line_number":455,"context_line":"            mock.patch.object(ovs_lib.OVSBridge, \"remove_all_flows\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_3fa28dad","line":452,"updated":"2014-06-25 00:36:27.000000000","message":"this test needs to mock get_bridges too","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"69e384026a47f71f66dc39ab16ab0c486c3a6391","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":451,"context_line":"        with contextlib.nested("},{"line_number":452,"context_line":"            mock.patch.object(ip_lib, \"device_exists\"),"},{"line_number":453,"context_line":"            mock.patch.object(sys, \"exit\"),"},{"line_number":454,"context_line":"            mock.patch.object(utils, \"execute\"),"},{"line_number":455,"context_line":"            mock.patch.object(ovs_lib.OVSBridge, \"remove_all_flows\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_5a22fda3","line":452,"in_reply_to":"1ae5cdf2_3fa28dad","updated":"2014-06-25 09:08:12.000000000","message":"hi i had implemented mocking get bridges in this test for this revision but removed it as i taught mocking the get_bridges in the setup would cascade into the test.\nis this not the case? \n\ni remove the mock to not have duplication however\ni will add the mock as you suggest if it will not cascade.","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"1f30571485f5bb73073a16b4fee39e3e6316430f","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":451,"context_line":"        with contextlib.nested("},{"line_number":452,"context_line":"            mock.patch.object(ip_lib, \"device_exists\"),"},{"line_number":453,"context_line":"            mock.patch.object(sys, \"exit\"),"},{"line_number":454,"context_line":"            mock.patch.object(utils, \"execute\"),"},{"line_number":455,"context_line":"            mock.patch.object(ovs_lib.OVSBridge, \"remove_all_flows\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_e3c05de2","line":452,"in_reply_to":"1ae5cdf2_5a22fda3","updated":"2014-06-26 07:01:24.000000000","message":"what do you mean by \"cascade\"?","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"65db3cd4022a26edb506fdbea4d5a20f450becd4","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":"    def test_setup_physical_bridges(self):"},{"line_number":451,"context_line":"        with contextlib.nested("},{"line_number":452,"context_line":"            mock.patch.object(ip_lib, \"device_exists\"),"},{"line_number":453,"context_line":"            mock.patch.object(sys, \"exit\"),"},{"line_number":454,"context_line":"            mock.patch.object(utils, \"execute\"),"},{"line_number":455,"context_line":"            mock.patch.object(ovs_lib.OVSBridge, \"remove_all_flows\"),"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_d1a082a7","line":452,"in_reply_to":"1ae5cdf2_e3c05de2","updated":"2014-06-26 12:26:51.000000000","message":"it was my understanding that mocking the call to get_bridges in the setup function will result in it being mocked in all tests in this class.\n\nas the setup function is invoke before each test is run  any mocked functions/object would cascade into (be mocked in) each of the test. sorry if my first comment was unclear.\n\nthis would normally be true however as the mocks are defined in  a with contextlib.nested() block you are correct it will not cascade as the scope of the mock is limited to the contextlib block.\n\ni will resubmit the updated patch shortly with this change.","commit_id":"1626cec02d8b80e6af195bce4518710b188f02b2"}]}
