)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"808d7683a453b6c7297f6d3cb4cdf1f8cf926cb3","unresolved":false,"context_lines":[{"line_number":18,"context_line":"create(), update(), delete() methods makes calls to notify()"},{"line_number":19,"context_line":"method defined in neutron/openstack/common/notifier/api.py"},{"line_number":20,"context_line":"to generate these \".start\" and \".end\" notifications."},{"line_number":21,"context_line":"However, for special operations like adding or removing interface"},{"line_number":22,"context_line":"to/from a router, these are taken care in db modules."},{"line_number":23,"context_line":"E.g., add_router_interface() and remove_router_interface()"},{"line_number":24,"context_line":"methods inside ~neutron/db/l3_db.py."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1ae5cdf2_c248328a","line":21,"updated":"2014-06-07 18:24:25.000000000","message":"So probably this is what you\u0027re looking for:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/extensions/l3agentscheduler.py#L42\n\nHave a look there, you might be able to add notification methods there rather than here and keep the way notifications are handled consistent.","commit_id":"bf982b0e142ee2e83dffa506e9b40441fde069a1"}],"neutron/db/l3_agentschedulers_db.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7c5e6ec9b643bda7206067ef42fb277e2c329a83","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron.db import models_v2"},{"line_number":28,"context_line":"from neutron.extensions import l3agentscheduler"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":32,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"},{"line_number":33,"context_line":"               default\u003d\u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_b2d4a6e9","side":"PARENT","line":30,"updated":"2014-06-12 19:55:22.000000000","message":"Please do not change.","commit_id":"c0b6d596e696ee0c4bd5ef4c689c7b86548cfc23"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"efa91731931ab5ecc6985362a9a8934027cc8dde","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from neutron.db import models_v2"},{"line_number":28,"context_line":"from neutron.extensions import l3agentscheduler"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"L3_AGENTS_SCHEDULER_OPTS \u003d ["},{"line_number":32,"context_line":"    cfg.StrOpt(\u0027router_scheduler_driver\u0027,"},{"line_number":33,"context_line":"               default\u003d\u0027neutron.scheduler.l3_agent_scheduler.ChanceScheduler\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_e8aa916f","side":"PARENT","line":30,"in_reply_to":"1ae5cdf2_b2d4a6e9","updated":"2014-06-14 09:18:07.000000000","message":"Agree. I will submit another patch set. This change was unintentional.","commit_id":"c0b6d596e696ee0c4bd5ef4c689c7b86548cfc23"}],"neutron/extensions/l3agentscheduler.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7c5e6ec9b643bda7206067ef42fb277e2c329a83","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                       {})"},{"line_number":67,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":68,"context_line":"        router_id \u003d body[\u0027router_id\u0027]"},{"line_number":69,"context_line":"        plugin.add_router_to_l3_agent("},{"line_number":70,"context_line":"            request.context,"},{"line_number":71,"context_line":"            agent_id,"},{"line_number":72,"context_line":"            router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_5241a2a7","line":69,"updated":"2014-06-12 19:55:22.000000000","message":"you\u0027ve altered the behavior of this method. This used to return.","commit_id":"a29d11472d0eda65704300d8d394c12ced3f9118"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"efa91731931ab5ecc6985362a9a8934027cc8dde","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                       {})"},{"line_number":67,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":68,"context_line":"        router_id \u003d body[\u0027router_id\u0027]"},{"line_number":69,"context_line":"        plugin.add_router_to_l3_agent("},{"line_number":70,"context_line":"            request.context,"},{"line_number":71,"context_line":"            agent_id,"},{"line_number":72,"context_line":"            router_id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_28b8f9c6","line":69,"in_reply_to":"1ae5cdf2_5241a2a7","updated":"2014-06-14 09:18:07.000000000","message":"I agree. Will submit another patch set.","commit_id":"a29d11472d0eda65704300d8d394c12ced3f9118"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7c5e6ec9b643bda7206067ef42fb277e2c329a83","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                       \"delete_%s\" % L3_ROUTER,"},{"line_number":81,"context_line":"                       {})"},{"line_number":82,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":83,"context_line":"        plugin.remove_router_from_l3_agent("},{"line_number":84,"context_line":"            request.context,"},{"line_number":85,"context_line":"            agent_id,"},{"line_number":86,"context_line":"            id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_320ed68c","line":83,"updated":"2014-06-12 19:55:22.000000000","message":"so this one.","commit_id":"a29d11472d0eda65704300d8d394c12ced3f9118"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"efa91731931ab5ecc6985362a9a8934027cc8dde","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                       \"delete_%s\" % L3_ROUTER,"},{"line_number":81,"context_line":"                       {})"},{"line_number":82,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":83,"context_line":"        plugin.remove_router_from_l3_agent("},{"line_number":84,"context_line":"            request.context,"},{"line_number":85,"context_line":"            agent_id,"},{"line_number":86,"context_line":"            id)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ae5cdf2_08a6ddaa","line":83,"in_reply_to":"1ae5cdf2_320ed68c","updated":"2014-06-14 09:18:07.000000000","message":"I agree. Will submit another patch set.","commit_id":"a29d11472d0eda65704300d8d394c12ced3f9118"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a18f221c5108e77ce8527172b94172fe3f051f4b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                     agent_id)"},{"line_number":92,"context_line":"        return result"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _notify(self, context, action, router_id, agent_id):"},{"line_number":95,"context_line":"        info \u003d {\u0027id\u0027: agent_id,"},{"line_number":96,"context_line":"                \u0027router_id\u0027: router_id}"},{"line_number":97,"context_line":"        notifier_api.notify(context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_c225b6c2","line":94,"updated":"2014-06-21 17:59:07.000000000","message":"Why is this in the class?  This can be a helper method within the module becuase it does not need access to self.","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"882f87ba4ee9343f374f4697d3d1c3de0a9e1141","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                     agent_id)"},{"line_number":92,"context_line":"        return result"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"    def _notify(self, context, action, router_id, agent_id):"},{"line_number":95,"context_line":"        info \u003d {\u0027id\u0027: agent_id,"},{"line_number":96,"context_line":"                \u0027router_id\u0027: router_id}"},{"line_number":97,"context_line":"        notifier_api.notify(context,"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_9692ebfa","line":94,"in_reply_to":"1ae5cdf2_c225b6c2","updated":"2014-06-23 16:57:57.000000000","message":"Done","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":68,"context_line":"        router_id \u003d body[\u0027router_id\u0027]"},{"line_number":69,"context_line":"        result \u003d plugin.add_router_to_l3_agent("},{"line_number":70,"context_line":"            request.context,"},{"line_number":71,"context_line":"            agent_id,"},{"line_number":72,"context_line":"            router_id)"},{"line_number":73,"context_line":"        notify(request.context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_95f6e18d","line":70,"updated":"2014-07-11 19:29:04.000000000","message":"this does not need to break on multiple lines","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":68,"context_line":"        router_id \u003d body[\u0027router_id\u0027]"},{"line_number":69,"context_line":"        result \u003d plugin.add_router_to_l3_agent("},{"line_number":70,"context_line":"            request.context,"},{"line_number":71,"context_line":"            agent_id,"},{"line_number":72,"context_line":"            router_id)"},{"line_number":73,"context_line":"        notify(request.context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_3389636f","line":70,"in_reply_to":"baada198_95f6e18d","updated":"2014-07-15 06:24:02.000000000","message":"Done","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                       {})"},{"line_number":83,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":84,"context_line":"        result \u003d plugin.remove_router_from_l3_agent("},{"line_number":85,"context_line":"            request.context,"},{"line_number":86,"context_line":"            agent_id,"},{"line_number":87,"context_line":"            id)"},{"line_number":88,"context_line":"        notify(request.context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b5ef65b0","line":85,"updated":"2014-07-11 19:29:04.000000000","message":"this too","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":82,"context_line":"                       {})"},{"line_number":83,"context_line":"        agent_id \u003d kwargs[\u0027agent_id\u0027]"},{"line_number":84,"context_line":"        result \u003d plugin.remove_router_from_l3_agent("},{"line_number":85,"context_line":"            request.context,"},{"line_number":86,"context_line":"            agent_id,"},{"line_number":87,"context_line":"            id)"},{"line_number":88,"context_line":"        notify(request.context,"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_93f14f03","line":85,"in_reply_to":"baada198_b5ef65b0","updated":"2014-07-15 06:24:02.000000000","message":"Done","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"def notify(context, action, router_id, agent_id):"},{"line_number":213,"context_line":"    info \u003d {\u0027id\u0027: agent_id,"},{"line_number":214,"context_line":"            \u0027router_id\u0027: router_id}"},{"line_number":215,"context_line":"    notifier \u003d n_rpc.get_notifier(\u0027router\u0027)"},{"line_number":216,"context_line":"    notifier.info("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_d5ecd9bd","line":213,"updated":"2014-07-11 19:29:04.000000000","message":"this too","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"def notify(context, action, router_id, agent_id):"},{"line_number":213,"context_line":"    info \u003d {\u0027id\u0027: agent_id,"},{"line_number":214,"context_line":"            \u0027router_id\u0027: router_id}"},{"line_number":215,"context_line":"    notifier \u003d n_rpc.get_notifier(\u0027router\u0027)"},{"line_number":216,"context_line":"    notifier.info("}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_f3d9ab83","line":213,"in_reply_to":"baada198_d5ecd9bd","updated":"2014-07-15 06:24:02.000000000","message":"Done","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    info \u003d {\u0027id\u0027: agent_id,"},{"line_number":214,"context_line":"            \u0027router_id\u0027: router_id}"},{"line_number":215,"context_line":"    notifier \u003d n_rpc.get_notifier(\u0027router\u0027)"},{"line_number":216,"context_line":"    notifier.info("},{"line_number":217,"context_line":"        context, action, {\u0027agent\u0027: info})"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_35335563","line":216,"updated":"2014-07-11 19:29:04.000000000","message":"perhaps this one as well?","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":213,"context_line":"    info \u003d {\u0027id\u0027: agent_id,"},{"line_number":214,"context_line":"            \u0027router_id\u0027: router_id}"},{"line_number":215,"context_line":"    notifier \u003d n_rpc.get_notifier(\u0027router\u0027)"},{"line_number":216,"context_line":"    notifier.info("},{"line_number":217,"context_line":"        context, action, {\u0027agent\u0027: info})"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_13e53f37","line":216,"in_reply_to":"baada198_35335563","updated":"2014-07-15 06:24:02.000000000","message":"Done","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"}],"neutron/tests/unit/openvswitch/test_agent_scheduler.py":[{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"9edd6b803a9eaf83a8b05b5146955b976583c025","unresolved":false,"context_lines":[{"line_number":1213,"context_line":"                self._register_agent_states()"},{"line_number":1214,"context_line":"                hosta_id \u003d self._get_agent_id(constants.AGENT_TYPE_L3,"},{"line_number":1215,"context_line":"                                              L3_HOSTA)"},{"line_number":1216,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1217,"context_line":"                    self._add_router_to_l3_agent(hosta_id,"},{"line_number":1218,"context_line":"                                                 router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1219,"context_line":"                routers \u003d [router1[\u0027router\u0027][\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_cd9ceb60","line":1216,"updated":"2014-06-16 09:57:07.000000000","message":"Could you please add similar mocking of \u0027notify\u0027 method in following test methods as well:\r\n\r\ntest_router_add_to_l3_agent\r\ntest_router_add_to_l3_agent_two_times\r\ntest_router_sync_data\r\ntest_router_policy","commit_id":"c7df0bad18aff077080a98a8de2c1db526662380"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"5fb7b8f8acf320b71b658328d4edf511b8d890b8","unresolved":false,"context_lines":[{"line_number":1213,"context_line":"                self._register_agent_states()"},{"line_number":1214,"context_line":"                hosta_id \u003d self._get_agent_id(constants.AGENT_TYPE_L3,"},{"line_number":1215,"context_line":"                                              L3_HOSTA)"},{"line_number":1216,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1217,"context_line":"                    self._add_router_to_l3_agent(hosta_id,"},{"line_number":1218,"context_line":"                                                 router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1219,"context_line":"                routers \u003d [router1[\u0027router\u0027][\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_9d59085e","line":1216,"in_reply_to":"1ae5cdf2_cd9ceb60","updated":"2014-06-17 05:51:56.000000000","message":"Done","commit_id":"c7df0bad18aff077080a98a8de2c1db526662380"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a18f221c5108e77ce8527172b94172fe3f051f4b","unresolved":false,"context_lines":[{"line_number":925,"context_line":"                    break"},{"line_number":926,"context_line":"            self.assertIsNotNone(another_l3_agent_id)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            with mock.patch("},{"line_number":929,"context_line":"                \u0027neutron.extensions.l3agentscheduler.\u0027"},{"line_number":930,"context_line":"                \u0027RouterSchedulerController.\u0027"},{"line_number":931,"context_line":"                \u0027_notify\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_a23b4ae8","line":928,"updated":"2014-06-21 17:59:07.000000000","message":"Why not always mock this in the setUp()?","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"882f87ba4ee9343f374f4697d3d1c3de0a9e1141","unresolved":false,"context_lines":[{"line_number":925,"context_line":"                    break"},{"line_number":926,"context_line":"            self.assertIsNotNone(another_l3_agent_id)"},{"line_number":927,"context_line":""},{"line_number":928,"context_line":"            with mock.patch("},{"line_number":929,"context_line":"                \u0027neutron.extensions.l3agentscheduler.\u0027"},{"line_number":930,"context_line":"                \u0027RouterSchedulerController.\u0027"},{"line_number":931,"context_line":"                \u0027_notify\u0027):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_b697e7ea","line":928,"in_reply_to":"1ae5cdf2_a23b4ae8","updated":"2014-06-23 16:57:57.000000000","message":"Done","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"67d7a3f0b02b232f678b97c38f91212f1ff74a1d","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                self._register_agent_states()"},{"line_number":1235,"context_line":"                hosta_id \u003d self._get_agent_id(constants.AGENT_TYPE_L3,"},{"line_number":1236,"context_line":"                                              L3_HOSTA)"},{"line_number":1237,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1238,"context_line":"                    self._add_router_to_l3_agent(hosta_id,"},{"line_number":1239,"context_line":"                                                 router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1240,"context_line":"                routers \u003d [router1[\u0027router\u0027][\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_101cff76","line":1237,"updated":"2014-06-17 06:16:17.000000000","message":"Please make this invocation also with the parent method mock ie., (_notifiy() mock) , so that they are uniform.","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"8a867c2d0e175b315ba00688f779f7a8f1e58386","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                self._register_agent_states()"},{"line_number":1235,"context_line":"                hosta_id \u003d self._get_agent_id(constants.AGENT_TYPE_L3,"},{"line_number":1236,"context_line":"                                              L3_HOSTA)"},{"line_number":1237,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1238,"context_line":"                    self._add_router_to_l3_agent(hosta_id,"},{"line_number":1239,"context_line":"                                                 router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1240,"context_line":"                routers \u003d [router1[\u0027router\u0027][\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_b3743537","line":1237,"in_reply_to":"1ae5cdf2_101cff76","updated":"2014-06-17 06:41:37.000000000","message":"Here, we want to test that the actual code fix of audit notify() call that is introduced inside extensions/l3agentscheduler.py is really executed with expected arguments. Therefore, this method is mocked in this fashion so that arguments passed inside this method is also validated. Similarly, for test_router_remove_from_l3_agent_notification. \n\nHowever, in other places, it\u0027s mocked in a different manner as I don\u0027t want to validate the actual fix. It only ensures that actual notify() method is not called unnecessarily as you commented in the patch set 3.","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"25aaf0f78035db37b35e7c642179faf882ae17bb","unresolved":false,"context_lines":[{"line_number":1234,"context_line":"                self._register_agent_states()"},{"line_number":1235,"context_line":"                hosta_id \u003d self._get_agent_id(constants.AGENT_TYPE_L3,"},{"line_number":1236,"context_line":"                                              L3_HOSTA)"},{"line_number":1237,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1238,"context_line":"                    self._add_router_to_l3_agent(hosta_id,"},{"line_number":1239,"context_line":"                                                 router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1240,"context_line":"                routers \u003d [router1[\u0027router\u0027][\u0027id\u0027]]"}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_53d5b1b7","line":1237,"in_reply_to":"1ae5cdf2_b3743537","updated":"2014-06-17 06:52:20.000000000","message":"OK.","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"67d7a3f0b02b232f678b97c38f91212f1ff74a1d","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"                                              L3_HOSTA)"},{"line_number":1257,"context_line":"                self._add_router_to_l3_agent(hosta_id,"},{"line_number":1258,"context_line":"                                             router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1259,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1260,"context_line":"                    self._remove_router_from_l3_agent(hosta_id,"},{"line_number":1261,"context_line":"                                                      router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1262,"context_line":"            mock_l3.assert_called_with("}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_90072f1d","line":1259,"updated":"2014-06-17 06:16:17.000000000","message":"Please make this invocation also with the parent method mock ie., (_notifiy() mock) , so that they are uniform.","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"8a867c2d0e175b315ba00688f779f7a8f1e58386","unresolved":false,"context_lines":[{"line_number":1256,"context_line":"                                              L3_HOSTA)"},{"line_number":1257,"context_line":"                self._add_router_to_l3_agent(hosta_id,"},{"line_number":1258,"context_line":"                                             router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1259,"context_line":"                with mock.patch.object(notifier_api, \u0027notify\u0027) as mynotifier:"},{"line_number":1260,"context_line":"                    self._remove_router_from_l3_agent(hosta_id,"},{"line_number":1261,"context_line":"                                                      router1[\u0027router\u0027][\u0027id\u0027])"},{"line_number":1262,"context_line":"            mock_l3.assert_called_with("}],"source_content_type":"text/x-python","patch_set":4,"id":"1ae5cdf2_539db158","line":1259,"in_reply_to":"1ae5cdf2_90072f1d","updated":"2014-06-17 06:41:37.000000000","message":"Same comment as above","commit_id":"c3f5aa8a282ccfc6ba8d6da5b6dafa87eb1bc974"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def _assert_notify(self, notifications, expected_event_type):"},{"line_number":175,"context_line":"        actual_event_type \u003d None"},{"line_number":176,"context_line":"        for event in notifications:"},{"line_number":177,"context_line":"            if event[\u0027event_type\u0027] \u003d\u003d expected_event_type:"},{"line_number":178,"context_line":"                actual_event_type \u003d event[\u0027event_type\u0027]"},{"line_number":179,"context_line":"        self.assertEqual(actual_event_type, expected_event_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_f5de3d10","line":176,"updated":"2014-07-11 19:29:04.000000000","message":"This method reads funny because the for could stop when the if is true, which makes the assert redundant. What about?\n\n    event_types \u003d [event[\u0027event_types\u0027] for event in notifications]\n    self.assertIn(expected_event_type, event_types)\n\n2 lines against 5","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":173,"context_line":""},{"line_number":174,"context_line":"    def _assert_notify(self, notifications, expected_event_type):"},{"line_number":175,"context_line":"        actual_event_type \u003d None"},{"line_number":176,"context_line":"        for event in notifications:"},{"line_number":177,"context_line":"            if event[\u0027event_type\u0027] \u003d\u003d expected_event_type:"},{"line_number":178,"context_line":"                actual_event_type \u003d event[\u0027event_type\u0027]"},{"line_number":179,"context_line":"        self.assertEqual(actual_event_type, expected_event_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_73d59b41","line":176,"in_reply_to":"baada198_f5de3d10","updated":"2014-07-15 06:24:02.000000000","message":"Thanks for the suggestion. \nDone","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"2e9a248fd39c098445cd8b8f392daeb735341b51","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.notify_p \u003d mock.patch("},{"line_number":235,"context_line":"            \u0027neutron.extensions.l3agentscheduler.notify\u0027)"},{"line_number":236,"context_line":"        self.patched_notify \u003d self.notify_p.start()"},{"line_number":237,"context_line":"        self.addCleanup(self.notify_p.stop)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def restore_attribute_map(self):"},{"line_number":240,"context_line":"        # Restore the original RESOURCE_ATTRIBUTE_MAP"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_150c91ec","line":237,"updated":"2014-07-11 19:29:04.000000000","message":"The stop is no longer necessary at there is a stopall in the base class:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/tests/base.py#L158","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"c166a24722f3e0f2d8a88330bb84c380bb2d65fe","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.notify_p \u003d mock.patch("},{"line_number":235,"context_line":"            \u0027neutron.extensions.l3agentscheduler.notify\u0027)"},{"line_number":236,"context_line":"        self.patched_notify \u003d self.notify_p.start()"},{"line_number":237,"context_line":"        self.addCleanup(self.notify_p.stop)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def restore_attribute_map(self):"},{"line_number":240,"context_line":"        # Restore the original RESOURCE_ATTRIBUTE_MAP"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_45bf06fc","line":237,"updated":"2014-07-27 23:28:52.000000000","message":"this is not necessary because we call stopall after every test","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"},{"author":{"_account_id":10780,"name":"Maruti Kamat","email":"maruti.kamat@hp.com","username":"marutik"},"change_message_id":"70465bc723bb50616ebad58ad8382c5bd7392e10","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.notify_p \u003d mock.patch("},{"line_number":235,"context_line":"            \u0027neutron.extensions.l3agentscheduler.notify\u0027)"},{"line_number":236,"context_line":"        self.patched_notify \u003d self.notify_p.start()"},{"line_number":237,"context_line":"        self.addCleanup(self.notify_p.stop)"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def restore_attribute_map(self):"},{"line_number":240,"context_line":"        # Restore the original RESOURCE_ATTRIBUTE_MAP"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_33b7a322","line":237,"in_reply_to":"baada198_150c91ec","updated":"2014-07-15 06:24:02.000000000","message":"Done","commit_id":"acb3a2ca578cfc42f3fbbb88a418d96431644554"}]}
