)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7cd91eff5bffcbcf747989fe898a8e56428867f4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_1f52c711","line":9,"updated":"2014-08-11 13:24:26.000000000","message":"*will fix the issue\n\n(missing \"the\")","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70f2051f99c3a7b83a0299686e3ed4ffd96bb068","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_b20c9445","line":9,"in_reply_to":"baada198_1f52c711","updated":"2014-08-12 05:12:53.000000000","message":"Also use \u0027in DVR mode\u0027 instead of \u0027under DVR mode\u0027.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_1a281284","line":9,"in_reply_to":"baada198_1f52c711","updated":"2014-08-12 06:29:10.000000000","message":"Will fix it.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7cd91eff5bffcbcf747989fe898a8e56428867f4","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-bug: 1353266"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_1fc5678f","line":10,"updated":"2014-08-11 13:24:26.000000000","message":"\"it\", in this context refers to \"nodes\", since \"nodes\" is plural, so should \"it\" \u003d\u003e \"them\"\n\nalso, IMO, I\u0027d say it sounds better:\n\"even if there are no VMs hosted on them...\"","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70f2051f99c3a7b83a0299686e3ed4ffd96bb068","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-bug: 1353266"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_121e2074","line":10,"in_reply_to":"baada198_1fc5678f","updated":"2014-08-12 05:12:53.000000000","message":"Also rephrase as\u0027hosted on them\u0027 for the attached subnet.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix dvr router getting scheduled on router update"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix issue where under DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if no VM is hosted on it for the"},{"line_number":11,"context_line":"attached subnet."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-bug: 1353266"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_ba2e468b","line":10,"in_reply_to":"baada198_1fc5678f","updated":"2014-08-12 06:29:10.000000000","message":"Thanks, will change and make it more meaningful.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"ade625c892cae20fdb7d2ad51181440131056d9d","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix the issue where in DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if there are no VMs hosted on"},{"line_number":11,"context_line":"them for the attached subnet."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-bug: 1353266"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"baada198_de7c6e25","line":11,"updated":"2014-08-13 12:10:30.000000000","message":"minor nit:\r\nplease rephrase the commit content :\r\n\r\nThis commit will fix the issue where in DVR mode,  router update command  creates router namespaces on nodes,   \r\neven if there are no VMs hosted on them for the attached subnet","commit_id":"eec10c461c48b87a92ae635dd39e3882227d902b"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"420d0debe08d54fd48f70a3f000063ceb522c74b","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This commit will fix the issue where in DVR mode router update command"},{"line_number":10,"context_line":"creates router namespaces on nodes even if there are no VMs hosted on"},{"line_number":11,"context_line":"them for the attached subnet."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Closes-bug: 1353266"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"baada198_9e5d9657","line":11,"in_reply_to":"baada198_de7c6e25","updated":"2014-08-15 04:08:33.000000000","message":"Done, Thanks.","commit_id":"eec10c461c48b87a92ae635dd39e3882227d902b"}],"neutron/db/l3_db.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"b75ff14bae5fe7195cace8ba590de3998fded79e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                            gw_info, router\u003drouter_db)"},{"line_number":150,"context_line":"        return self._make_router_dict(router_db)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _get_subnets_on_router(self, context, router_id):"},{"line_number":153,"context_line":"        \"\"\"Return subnet IDs for interfaces attached to the given router.\"\"\""},{"line_number":154,"context_line":"        subnet_ids \u003d set()"},{"line_number":155,"context_line":"        filter_rtr \u003d {\u0027device_id\u0027: [router_id]}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_3fe52fa4","line":152,"updated":"2014-08-07 14:12:02.000000000","message":"this logic must go to l3_dvr_db, if possible.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"38056b361f78ea2b6fbaf0bf6b793d278124b43e","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                            gw_info, router\u003drouter_db)"},{"line_number":150,"context_line":"        return self._make_router_dict(router_db)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _get_subnets_on_router(self, context, router_id):"},{"line_number":153,"context_line":"        \"\"\"Return subnet IDs for interfaces attached to the given router.\"\"\""},{"line_number":154,"context_line":"        subnet_ids \u003d set()"},{"line_number":155,"context_line":"        filter_rtr \u003d {\u0027device_id\u0027: [router_id]}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_43fe896b","line":152,"in_reply_to":"baada198_362b94eb","updated":"2014-08-07 17:21:50.000000000","message":"get_subnet_ids_on_router(self, context, router_id) is already defined in the l3_dvr_scheduler_db.py.\nYou can make use of that function in the DVRSchedulerdbmixin class. you don\u0027t need to refine it here.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"770a55ca941f09b7f3a4f74cb8ab1f14a45456c5","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                            gw_info, router\u003drouter_db)"},{"line_number":150,"context_line":"        return self._make_router_dict(router_db)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _get_subnets_on_router(self, context, router_id):"},{"line_number":153,"context_line":"        \"\"\"Return subnet IDs for interfaces attached to the given router.\"\"\""},{"line_number":154,"context_line":"        subnet_ids \u003d set()"},{"line_number":155,"context_line":"        filter_rtr \u003d {\u0027device_id\u0027: [router_id]}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_b6bb240f","line":152,"in_reply_to":"baada198_3fe52fa4","updated":"2014-08-07 16:12:34.000000000","message":"This logic is generic to all routers and not specific to distributed routers. \r\n As a result it is better to have this stay in l3_db.  The l3_dvr_db can invoke this from l3_db.  \r\n\r\nAlready another implementation of this same method is in l3_dvrscheduler_db.py which again can be updated to invoke from l3_db.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"8585366c419c61731e4222f06d4781cb58bb7163","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                            gw_info, router\u003drouter_db)"},{"line_number":150,"context_line":"        return self._make_router_dict(router_db)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _get_subnets_on_router(self, context, router_id):"},{"line_number":153,"context_line":"        \"\"\"Return subnet IDs for interfaces attached to the given router.\"\"\""},{"line_number":154,"context_line":"        subnet_ids \u003d set()"},{"line_number":155,"context_line":"        filter_rtr \u003d {\u0027device_id\u0027: [router_id]}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c52d1dff","line":152,"in_reply_to":"baada198_43fe896b","updated":"2014-08-08 13:50:43.000000000","message":"Working on to use the existing function.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f565fa013f5b3d23e1b58591ccb46301c3ca6af5","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                                            gw_info, router\u003drouter_db)"},{"line_number":150,"context_line":"        return self._make_router_dict(router_db)"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"    def _get_subnets_on_router(self, context, router_id):"},{"line_number":153,"context_line":"        \"\"\"Return subnet IDs for interfaces attached to the given router.\"\"\""},{"line_number":154,"context_line":"        subnet_ids \u003d set()"},{"line_number":155,"context_line":"        filter_rtr \u003d {\u0027device_id\u0027: [router_id]}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_362b94eb","line":152,"in_reply_to":"baada198_b6bb240f","updated":"2014-08-07 16:23:31.000000000","message":"I suppose you\u0027re right, please see my comment below.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f565fa013f5b3d23e1b58591ccb46301c3ca6af5","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":190,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":191,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":192,"context_line":"        subnet_ids \u003d self. _get_subnets_on_router(context, id)"},{"line_number":193,"context_line":"        for subnet in subnet_ids:"},{"line_number":194,"context_line":"            payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":195,"context_line":"            self.l3_rpc_notifier.routers_updated(context, [router_db[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_b6efa4b1","line":192,"updated":"2014-08-07 16:23:31.000000000","message":"you\u0027re altering the logic also for non-dvr routers, I am not sure this is the right thing to do.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"8585366c419c61731e4222f06d4781cb58bb7163","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":190,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":191,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":192,"context_line":"        subnet_ids \u003d self. _get_subnets_on_router(context, id)"},{"line_number":193,"context_line":"        for subnet in subnet_ids:"},{"line_number":194,"context_line":"            payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":195,"context_line":"            self.l3_rpc_notifier.routers_updated(context, [router_db[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_45c4ad40","line":192,"in_reply_to":"baada198_4309292a","updated":"2014-08-08 13:50:43.000000000","message":"Working on to modifying the code to address this concern of not disturbing the existing non dvr logic.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"84192b97ea08218fedeee985624bff9573090119","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":190,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":191,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":192,"context_line":"        subnet_ids \u003d self. _get_subnets_on_router(context, id)"},{"line_number":193,"context_line":"        for subnet in subnet_ids:"},{"line_number":194,"context_line":"            payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":195,"context_line":"            self.l3_rpc_notifier.routers_updated(context, [router_db[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_4309292a","line":192,"in_reply_to":"baada198_718356cb","updated":"2014-08-07 17:04:44.000000000","message":"I appreciate that it should be okay; what I am saying is for centralized routers this could not be needed at all. We\u0027re sending multiple RPC messages now (one per subnet) whereas before we didn\u0027t. We want to minimize the impact on the existing functionality, even if it was just performance-related.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"7cddfff9796683913d83d59a3881687da109f3a8","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            l3_plugin \u003d manager.NeutronManager.get_service_plugins().get("},{"line_number":190,"context_line":"                constants.L3_ROUTER_NAT)"},{"line_number":191,"context_line":"            l3_plugin.reschedule_router(context, id, candidates)"},{"line_number":192,"context_line":"        subnet_ids \u003d self. _get_subnets_on_router(context, id)"},{"line_number":193,"context_line":"        for subnet in subnet_ids:"},{"line_number":194,"context_line":"            payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":195,"context_line":"            self.l3_rpc_notifier.routers_updated(context, [router_db[\u0027id\u0027]],"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_718356cb","line":192,"in_reply_to":"baada198_b6efa4b1","updated":"2014-08-07 16:55:13.000000000","message":"The payload data filled here is for use by l3_rpc_agent_api only (_notification and _agent_notification methods in there) and are never sent to l3_agent downstream. Only arp notifications use the payload, but that payload content is entirely different.\r\n\r\nFurther existing l3_agent_scheduler uses payload sent to schedule snat routers.\r\n\r\nSo this shoud be ok.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f565fa013f5b3d23e1b58591ccb46301c3ca6af5","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def notify_router_interface_action("},{"line_number":487,"context_line":"            self, context, router_id, tenant_id, port_id, subnet_id, action):"},{"line_number":488,"context_line":"        l3_method \u003d \u0027%s_router_interface\u0027 % action"},{"line_number":489,"context_line":"        self.l3_rpc_notifier.routers_updated(context, [router_id], l3_method,"},{"line_number":490,"context_line":"                                             {\u0027subnet_id\u0027: subnet_id})"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        mapping \u003d {\u0027add\u0027: \u0027create\u0027, \u0027remove\u0027: \u0027delete\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_1601306d","line":489,"updated":"2014-08-07 16:23:31.000000000","message":"this line shouldn\u0027t change","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"8585366c419c61731e4222f06d4781cb58bb7163","unresolved":false,"context_lines":[{"line_number":486,"context_line":"    def notify_router_interface_action("},{"line_number":487,"context_line":"            self, context, router_id, tenant_id, port_id, subnet_id, action):"},{"line_number":488,"context_line":"        l3_method \u003d \u0027%s_router_interface\u0027 % action"},{"line_number":489,"context_line":"        self.l3_rpc_notifier.routers_updated(context, [router_id], l3_method,"},{"line_number":490,"context_line":"                                             {\u0027subnet_id\u0027: subnet_id})"},{"line_number":491,"context_line":""},{"line_number":492,"context_line":"        mapping \u003d {\u0027add\u0027: \u0027create\u0027, \u0027remove\u0027: \u0027delete\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"baada198_c58a7d19","line":489,"in_reply_to":"baada198_1601306d","updated":"2014-08-08 13:50:43.000000000","message":"This line was modified due to pep8 error.","commit_id":"1c08246c05a7abcd12f56e51ae55e47c1aa50014"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"cd8c6789b5902178e201043ef756fbabdd8a8320","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"class L3_NAT_db_mixin(L3_NAT_dbonly_mixin, L3RpcNotifierMixin):"},{"line_number":1062,"context_line":"    \"\"\"Mixin class to add rpc notifier methods to db_base_plugin_v2.\"\"\""},{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"    def update_router(self, context, id, router, payload\u003d{},"},{"line_number":1065,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1066,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1067,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_3f62443d","line":1064,"updated":"2014-08-10 12:38:32.000000000","message":"A methods arguments should not be mutable. This should be payload\u003dNone","commit_id":"709ffcaa658f5a9e21310c5b25e342421947ef53"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"b2dfc2ad4b363c1abd720812e0526c8fe89efe42","unresolved":false,"context_lines":[{"line_number":1061,"context_line":"class L3_NAT_db_mixin(L3_NAT_dbonly_mixin, L3RpcNotifierMixin):"},{"line_number":1062,"context_line":"    \"\"\"Mixin class to add rpc notifier methods to db_base_plugin_v2.\"\"\""},{"line_number":1063,"context_line":""},{"line_number":1064,"context_line":"    def update_router(self, context, id, router, payload\u003d{},"},{"line_number":1065,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1066,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1067,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"}],"source_content_type":"text/x-python","patch_set":4,"id":"baada198_568c332e","line":1064,"in_reply_to":"baada198_3f62443d","updated":"2014-08-11 09:03:32.000000000","message":"Thanks I will change it.","commit_id":"709ffcaa658f5a9e21310c5b25e342421947ef53"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"4323faad10b6dd3d4ac1f4e86ce43e4520a7ea00","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_c5f880c3","line":1070,"updated":"2014-08-11 14:07:01.000000000","message":"This should be payload[\u0027gw_exists\u0027] because otherwise You are overwriting passed payload contents","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"f91155985b848b1054b240bd2811fad1f600b511","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_29e736d8","line":1070,"in_reply_to":"baada198_01d96cf3","updated":"2014-08-12 09:28:06.000000000","message":"I wanted the payload populated in update_router() in class L3_NAT_db_mixin to be available in update_router() defined in class L3_NAT_with_dvr_db_mixin.\nI tried it locally and found that payload \u003d {\u0027gw_exists\u0027} is visible in derived class.\nJust to clarify this is what the requirement is, and this code satisfies the need\nclass Base(object):\n    def foo(self, name, age, sex, payload\u003dNone, flag\u003dTrue):\n        print \"Base class foo()\"\n        if payload is None:\n            payload \u003d {}\n        payload[\u0027gw_exists\u0027] \u003d \u0027yes\u0027\n        print \"Payload in Base class: \", payload\n\nclass Derived(Base):\n    def foo(self):\n        print \"Derived class foo()\"\n        payload \u003d {}\n        super(Derived, self).foo(\u0027XYZ\u0027, 2, \u0027F\u0027, payload, False)\n        payload[\u0027subnet_id\u0027] \u003d \u002712345\u0027\n        print \"Payload in Derived class: \", payload\n\nprint \"Invoking Base Class\"\nBase().foo(\u0027ABC\u0027, 1, \u0027M\u0027)\nprint \"Invoking Derived Class\"\nDerived().foo()\n\nOutpu is:\nInvoking Base Class\nBase class foo()\nPayload in Base class:  {\u0027gw_exists\u0027: \u0027yes\u0027}\nInvoking Derived Class\nDerived class foo()\nBase class foo()\nPayload in Base class:  {\u0027gw_exists\u0027: \u0027yes\u0027}\nPayload in Derived class:  {\u0027gw_exists\u0027: \u0027yes\u0027, \u0027subnet_id\u0027: \u002712345\u0027}","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"3098533737757833b2708e4b048f7402e75e8b19","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_4c0398bd","line":1070,"in_reply_to":"baada198_29e736d8","updated":"2014-08-12 09:47:02.000000000","message":"So payload[\u0027gw_exists\u0027] \u003d ... fulfils your intentions, while with payload \u003d {\u0027gw_exists\u0027: ...} prints only Payload in Derived class: {\u0027subnet_id\u0027: \u002712345\u0027}","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"be28b104c87c1d7d568d8e2e2ee49095154534c4","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_fd3974cf","line":1070,"in_reply_to":"baada198_4c0398bd","updated":"2014-08-12 10:58:31.000000000","message":"In my case I will be inserting the payload{\u0027subnet_id\u0027:} as an additional field in the derived update_router() method. The super class is not required to know the subnet id hence I am not filling it in derived class. The idea was to keep the existing functionality of Base class update_router() intact","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_f75e1778","line":1070,"in_reply_to":"baada198_c5f880c3","updated":"2014-08-12 06:29:10.000000000","message":"The intention is to have the value of payload reflecting/available in the overridden update_router method so that the dict can be populated with additional data (like subnet_ids) required for further execution.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":12737,"name":"Jacek Swiderski","email":"jacek.swiderski@codilime.com","username":"Altran"},"change_message_id":"b3a4f59a18a345876443109a91a003e428374fa7","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"        if payload is None:"},{"line_number":1068,"context_line":"            payload \u003d {}"},{"line_number":1069,"context_line":""},{"line_number":1070,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1071,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1072,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1073,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_01d96cf3","line":1070,"in_reply_to":"baada198_f75e1778","updated":"2014-08-12 07:56:49.000000000","message":"So if I understand You right, Your intention is for data added to payload in this method(like subnet_ids) to be available in L3_NAT_with_dvr_db_mixin.update_router ? Then You need to change it either way because it won\u0027t work like that, it will create new dict and not modify the passed one.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"4b783b87144eace63b1d80630c0f0dddd050272a","unresolved":false,"context_lines":[{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1059,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1060,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1061,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"},{"line_number":1062,"context_line":"                                                                 id, router)"},{"line_number":1063,"context_line":"        if invoke_routers_updated:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_6e73b74f","line":1060,"updated":"2014-08-13 10:50:22.000000000","message":"This destroys content of payload passed in.  Please\r\nassign this differently like:\r\npayload[\u0027gw_exists\u0027] \u003d (r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d attributes.ATTR_NOT_SPECIFIED)","commit_id":"7a14cfc46fa77e073ac3613beaeedb225e01e865"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d830bfa7392f7418c031cdf819b6746be2a67892","unresolved":false,"context_lines":[{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload \u003d {\u0027gw_exists\u0027:"},{"line_number":1059,"context_line":"                   r.get(EXTERNAL_GW_INFO, attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":1060,"context_line":"                   attributes.ATTR_NOT_SPECIFIED}"},{"line_number":1061,"context_line":"        router_dict \u003d super(L3_NAT_db_mixin, self).update_router(context,"},{"line_number":1062,"context_line":"                                                                 id, router)"},{"line_number":1063,"context_line":"        if invoke_routers_updated:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_e9034173","line":1060,"in_reply_to":"baada198_6e73b74f","updated":"2014-08-13 11:20:10.000000000","message":"I noticed that and will upload new patch addressing the same.","commit_id":"7a14cfc46fa77e073ac3613beaeedb225e01e865"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2fba8fe0","line":1055,"updated":"2014-08-13 15:25:23.000000000","message":"nit: this can be:\n\npayload \u003d payload or {\u0027gw_exist\u0027: ...}","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"624371143235c5666143ae809f12078fb9cd1cd6","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_9844e775","line":1055,"in_reply_to":"7ac7a964_b00b882a","updated":"2014-08-15 04:08:02.000000000","message":"Since the class in l3_dvr_db.py is deriving and depends on l3_db.py, the challenge was to fix the bug such that we should not break the existing working functionality. So putting fix in isolation within l3_dvr_db.py was ruled out. Still I will re-check if that is a doable option.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a4d3c478bef5bad5c3d41db0ba7085f9685685ea","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_f07cef76","line":1055,"in_reply_to":"baada198_2d0a94d1","updated":"2014-08-13 17:38:27.000000000","message":"this intermingling between base and derived is very troublesome in my opinion. I don\u0027t understand your point fully. What is the case where lines 1055-1060 and my suggestion are not functionally equivalent?","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2d0a94d1","line":1055,"in_reply_to":"baada198_2fba8fe0","updated":"2014-08-13 17:08:20.000000000","message":"If the call comes to this function from derived class and if I do this \"payload \u003d payload or {\u0027gw_exist\u0027: ...}\" then it will create a new dict which I did not wanted. The intention was to populate the passed payload argument by the derived class so that when the control goes back to the derived class I will have the \u0027gw_exist\u0027 available, and to which subnet_id will be appended and then router_updated() call is made. When someone directly makes call to update_router() in Base class, the router_updated() call will be made with payload dict, only containing \u0027gw_exist\u0027. I did not wanted to break some functionality which are directly calling L3_NAT_db_mixin()\u0027s update_router() method.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"af4756c5659d586aa423a8fdb6af9738b949ad36","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_c414bcf7","line":1055,"in_reply_to":"baada198_f07cef76","updated":"2014-08-14 07:48:02.000000000","message":"If we donot have DVR extension enabled, then l3_db.L3_NAT_Db_Mixin will be the one utilized.  At that point, payload will be None, and so this update_router should allocate a dict to fill out things.\r\n\r\nI understand that payload is allocated in derived class, then streamed to base-class and again consumed in derived class.\r\nThis has to be done to ensure both these classes handle gw_exists properly. Further , this avoids code duplication and thence error propogation.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":7016,"name":"Swaminathan Vasudevan","email":"swvasude@cisco.com","username":"souminathan"},"change_message_id":"57c8016e7b544698860526e16cbfed50ef30dd79","unresolved":false,"context_lines":[{"line_number":1052,"context_line":"    def update_router(self, context, id, router, payload\u003dNone,"},{"line_number":1053,"context_line":"                      invoke_routers_updated\u003dTrue):"},{"line_number":1054,"context_line":"        r \u003d router[\u0027router\u0027]"},{"line_number":1055,"context_line":"        if payload is None:"},{"line_number":1056,"context_line":"            payload \u003d {}"},{"line_number":1057,"context_line":""},{"line_number":1058,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r.get(EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_b00b882a","line":1055,"in_reply_to":"baada198_f07cef76","updated":"2014-08-14 00:29:36.000000000","message":"Vinod you don\u0027t need to touch the Base class, you can do all your changes in the l3_dvr_db.py.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"}],"neutron/db/l3_dvr_db.py":[{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"76527172535317aa3eb13f97f02d8b03fdd41036","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        router_db \u003d\\"},{"line_number":111,"context_line":"            super(L3_NAT_with_dvr_db_mixin, self).update_router("},{"line_number":112,"context_line":"                                                context, id,"},{"line_number":113,"context_line":"                                                router, payload,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_8c987e1b","line":110,"updated":"2014-08-11 10:03:11.000000000","message":"nit: use parens to handle line breaks instead of \\\n\n router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self).\n              update_router(...))","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        router_db \u003d\\"},{"line_number":111,"context_line":"            super(L3_NAT_with_dvr_db_mixin, self).update_router("},{"line_number":112,"context_line":"                                                context, id,"},{"line_number":113,"context_line":"                                                router, payload,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_fad19e2f","line":110,"in_reply_to":"baada198_3f0dcbe7","updated":"2014-08-12 06:29:10.000000000","message":"Will change and see which one works and acceptable to pep8.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7cd91eff5bffcbcf747989fe898a8e56428867f4","unresolved":false,"context_lines":[{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        router_db \u003d\\"},{"line_number":111,"context_line":"            super(L3_NAT_with_dvr_db_mixin, self).update_router("},{"line_number":112,"context_line":"                                                context, id,"},{"line_number":113,"context_line":"                                                router, payload,"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_3f0dcbe7","line":110,"in_reply_to":"baada198_8c987e1b","updated":"2014-08-11 13:24:26.000000000","message":"agreed. Or you could also try:\n\nrouter_db \u003d super(L3_NAT_with_dvr_db_mixin, \n                           self).update_router(...)","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"76527172535317aa3eb13f97f02d8b03fdd41036","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                                router, payload,"},{"line_number":114,"context_line":"                                                invoke_routers_updated\u003dFalse)"},{"line_number":115,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":116,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":117,"context_line":"            subnet_ids \u003d\\"},{"line_number":118,"context_line":"                l3_dvrsched_db.L3_DVRsch_db_mixin.\\"},{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_8c66be26","line":116,"updated":"2014-08-11 10:03:11.000000000","message":"is it guaranteed that router db object will always have extra_attributes?","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70f2051f99c3a7b83a0299686e3ed4ffd96bb068","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                                router, payload,"},{"line_number":114,"context_line":"                                                invoke_routers_updated\u003dFalse)"},{"line_number":115,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":116,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":117,"context_line":"            subnet_ids \u003d\\"},{"line_number":118,"context_line":"                l3_dvrsched_db.L3_DVRsch_db_mixin.\\"},{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_3545ce43","line":116,"in_reply_to":"baada198_8c66be26","updated":"2014-08-12 05:12:53.000000000","message":"Yes with DVR checked in completely already, the extra_attributes will be always there for router.  The value inside that for distributed will be either \u0027True\u0027 (or) \u0027False\u0027.\r\n\r\nHere \u0027True\u0027 is being checked.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"76527172535317aa3eb13f97f02d8b03fdd41036","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                                invoke_routers_updated\u003dFalse)"},{"line_number":115,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":116,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":117,"context_line":"            subnet_ids \u003d\\"},{"line_number":118,"context_line":"                l3_dvrsched_db.L3_DVRsch_db_mixin.\\"},{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"},{"line_number":120,"context_line":"            for subnet in subnet_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_0c8c6ed7","line":117,"updated":"2014-08-11 10:03:11.000000000","message":"same as above","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7cd91eff5bffcbcf747989fe898a8e56428867f4","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                                invoke_routers_updated\u003dFalse)"},{"line_number":115,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":116,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":117,"context_line":"            subnet_ids \u003d\\"},{"line_number":118,"context_line":"                l3_dvrsched_db.L3_DVRsch_db_mixin.\\"},{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"},{"line_number":120,"context_line":"            for subnet in subnet_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_ffa273ab","line":117,"in_reply_to":"baada198_0c8c6ed7","updated":"2014-08-11 13:24:26.000000000","message":"I don\u0027t think that will do the trick in this case, since he has to use the backslash twice (line below).\n\nyou could try:\n\nl3_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin\n\nsubnet_ids \u003d l3_mixin.get_subnet_ids_on_router(...)","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                                                invoke_routers_updated\u003dFalse)"},{"line_number":115,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":116,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":117,"context_line":"            subnet_ids \u003d\\"},{"line_number":118,"context_line":"                l3_dvrsched_db.L3_DVRsch_db_mixin.\\"},{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"},{"line_number":120,"context_line":"            for subnet in subnet_ids:"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_5ae60ab0","line":117,"in_reply_to":"baada198_ffa273ab","updated":"2014-08-12 06:29:10.000000000","message":"I feel breaking into multiple statement is good suggestion in this case. Will tryout and see if that works.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7cd91eff5bffcbcf747989fe898a8e56428867f4","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"},{"line_number":120,"context_line":"            for subnet in subnet_ids:"},{"line_number":121,"context_line":"                rlist \u003d []"},{"line_number":122,"context_line":"                rlist.append(id)"},{"line_number":123,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":124,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":125,"context_line":"                                                     None, payload)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_5fa19f93","line":122,"updated":"2014-08-11 13:24:26.000000000","message":"you could just say:\n\nrlist \u003d [id]","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"f91155985b848b1054b240bd2811fad1f600b511","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                    get_subnet_ids_on_router(self, context, id)"},{"line_number":120,"context_line":"            for subnet in subnet_ids:"},{"line_number":121,"context_line":"                rlist \u003d []"},{"line_number":122,"context_line":"                rlist.append(id)"},{"line_number":123,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":124,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":125,"context_line":"                                                     None, payload)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_0948b2b2","line":122,"in_reply_to":"baada198_5fa19f93","updated":"2014-08-12 09:28:06.000000000","message":"Thanks will change it.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"a4bc0c8c6b92dccff74a88e607902fc688f83de1","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                rlist \u003d [id]"},{"line_number":124,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":125,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":126,"context_line":"                                                     None, payload)"},{"line_number":127,"context_line":"        return router_db"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b42b649a","line":126,"updated":"2014-08-13 08:45:04.000000000","message":"Would be better to slot out DVR and non-DVR sections here.\r\n\r\nIntermixing Super() calls for both makes difficult to read.\r\n\r\nAlso please use keyword_argument with name included when you pass them to super().  For ex, (not distributed) does not make it obvious, that it is a parameter being passed to avoid call to routers_updated in the parent.","commit_id":"6d67dbf34a43d61257e40956aab2ee134a19530c"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d29953203960d8b1628a37cf1ba272544875ea21","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                rlist \u003d [id]"},{"line_number":124,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":125,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":126,"context_line":"                                                     None, payload)"},{"line_number":127,"context_line":"        return router_db"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    def _delete_current_gw_port(self, context, router_id, router, new_network):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5d6eabff","line":126,"in_reply_to":"baada198_b42b649a","updated":"2014-08-13 12:16:09.000000000","message":"Will break the logic into if-else case statement and revert the flag variable name back to \"invoke_routers_updated\".","commit_id":"6d67dbf34a43d61257e40956aab2ee134a19530c"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"6d81b0cbdc1cda764c78dadb09dae5c0c0bc3dd0","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":111,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_039a1413","line":111,"updated":"2014-08-13 10:35:27.000000000","message":"could you remind, what is the guarantee that r.extra_attributes is never None?","commit_id":"7a14cfc46fa77e073ac3613beaeedb225e01e865"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"4b783b87144eace63b1d80630c0f0dddd050272a","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":111,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_8e99eb7c","line":111,"in_reply_to":"baada198_039a1413","updated":"2014-08-13 10:50:22.000000000","message":"Please look at line 116 here:\r\nhttps://review.openstack.org/#/c/112576/5/neutron/db/l3_dvr_db.py","commit_id":"7a14cfc46fa77e073ac3613beaeedb225e01e865"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"},{"line_number":115,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":116,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"},{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_6f99e76c","line":115,"updated":"2014-08-13 15:25:23.000000000","message":"we shouldn\u0027t initialize this mixin all the time.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a4d3c478bef5bad5c3d41db0ba7085f9685685ea","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"},{"line_number":115,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":116,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"},{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_f0ff8faf","line":115,"in_reply_to":"baada198_6df3ace8","updated":"2014-08-13 17:38:27.000000000","message":"you shouldn\u0027t be calling the method like this. this method it\u0027s available to the object you\u0027re calling from: it\u0027s ugly but that\u0027s the dirty business of mixins. Alternatively, a better separation of concerns would be to moving the method to this mixin instead, but the end result would be the same, as methods that do need \u0027get_subnet_ids_on_router\u0027 in l3_dvrscheduler_db will end up calling the method blindly.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"},{"line_number":115,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":116,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"},{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_6df3ace8","line":115,"in_reply_to":"baada198_6f99e76c","updated":"2014-08-13 17:08:20.000000000","message":"Since the statement was becoming big which had to break into multiple lines, there was suggestion from community to break this into multiple lines.\nSee Patch 5 (Comment From : Claudiu Belu).","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"624371143235c5666143ae809f12078fb9cd1cd6","unresolved":false,"context_lines":[{"line_number":112,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":113,"context_line":"                         update_router(context, id, router, payload,"},{"line_number":114,"context_line":"                                       invoke_routers_updated\u003dFalse))"},{"line_number":115,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":116,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"},{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_211d5710","line":115,"in_reply_to":"baada198_f0ff8faf","updated":"2014-08-15 04:08:02.000000000","message":"If I move the method in this mixin class then things will be more ugly because, l3_dvrscheduler_db.py file also has more than one place calling to get_subnet_ids_on_router(). So I feel its good to have this in one place rather than two.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"},{"line_number":119,"context_line":"            for subnet in subnet_ids:"},{"line_number":120,"context_line":"                rlist \u003d [id]"},{"line_number":121,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":122,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":123,"context_line":"                                                     None, payload)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0fd86b23","line":120,"updated":"2014-08-13 15:25:23.000000000","message":"this assignment is not needed imo","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                                                               context,"},{"line_number":118,"context_line":"                                                               id)"},{"line_number":119,"context_line":"            for subnet in subnet_ids:"},{"line_number":120,"context_line":"                rlist \u003d [id]"},{"line_number":121,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":122,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":123,"context_line":"                                                     None, payload)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_6d1acc1a","line":120,"in_reply_to":"baada198_0fd86b23","updated":"2014-08-13 17:08:20.000000000","message":"I can remove the temporary variable (rlist) and directly pass [id] in the function call. Like this..\nself.l3_rpc_notifier.routers_updated(context, [id], None, payload)","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                                               id)"},{"line_number":119,"context_line":"            for subnet in subnet_ids:"},{"line_number":120,"context_line":"                rlist \u003d [id]"},{"line_number":121,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":122,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":123,"context_line":"                                                     None, payload)"},{"line_number":124,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_8fcb9b4a","line":121,"updated":"2014-08-13 15:25:23.000000000","message":"and so is this one","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a4d3c478bef5bad5c3d41db0ba7085f9685685ea","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                                               id)"},{"line_number":119,"context_line":"            for subnet in subnet_ids:"},{"line_number":120,"context_line":"                rlist \u003d [id]"},{"line_number":121,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":122,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":123,"context_line":"                                                     None, payload)"},{"line_number":124,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_f00cef98","line":121,"in_reply_to":"baada198_2dd8d451","updated":"2014-08-13 17:38:27.000000000","message":"sorry, ignore my comment","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                                               id)"},{"line_number":119,"context_line":"            for subnet in subnet_ids:"},{"line_number":120,"context_line":"                rlist \u003d [id]"},{"line_number":121,"context_line":"                payload[\u0027subnet_id\u0027] \u003d subnet"},{"line_number":122,"context_line":"                self.l3_rpc_notifier.routers_updated(context, rlist,"},{"line_number":123,"context_line":"                                                     None, payload)"},{"line_number":124,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2dd8d451","line":121,"in_reply_to":"baada198_8fcb9b4a","updated":"2014-08-13 17:08:20.000000000","message":"This is in aligned with existing dvr_update_router_addvm() method in l3_dvrscheduler_db.py. In this method the payload is populated with \u0027subnet_id\u0027 while making call to routers_updated() method. I tried adhering to the existing approach which is working.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a3059b2943e51153246e34f8a88bc25bc446d501","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                context, router_id, router_db, data, gw_info)"},{"line_number":105,"context_line":"            return router_db"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r_update \u003d router[\u0027router\u0027]"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_7e8853c5","line":107,"updated":"2014-08-20 21:25:09.000000000","message":"Just start this method with the following and disregard Armando\u0027s comment on L131.  :P\n\n    r \u003d self._get_router(context, id)\n    router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self).\n                         update_router(context, id, router))\n    if not r.extra_attributes.distributed:\n        return router_db\n\nThen the rest of the method has less indentation.  Always a good thing.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":105,"context_line":"            return router_db"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r_update \u003d router[\u0027router\u0027]"},{"line_number":111,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r_update.get(l3.EXTERNAL_GW_INFO,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_a0eeb789","line":108,"updated":"2014-08-18 17:28:44.000000000","message":"this docstring does not make sense with the method name.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":106,"context_line":""},{"line_number":107,"context_line":"    def update_router(self, context, id, router):"},{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r_update \u003d router[\u0027router\u0027]"},{"line_number":111,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r_update.get(l3.EXTERNAL_GW_INFO,"},{"line_number":112,"context_line":"                                              attributes.ATTR_NOT_SPECIFIED) !\u003d"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_80f9bb4f","line":109,"updated":"2014-08-18 17:28:44.000000000","message":"this is superfluous; you can do:\n\npayload \u003d {\n  \u0027gw_exists\u0027: ...\n}","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a3059b2943e51153246e34f8a88bc25bc446d501","unresolved":false,"context_lines":[{"line_number":108,"context_line":"        \"\"\"Reschedule router if migration is occuring.\"\"\""},{"line_number":109,"context_line":"        payload \u003d {}"},{"line_number":110,"context_line":"        r_update \u003d router[\u0027router\u0027]"},{"line_number":111,"context_line":"        payload[\u0027gw_exists\u0027] \u003d ((r_update.get(l3.EXTERNAL_GW_INFO,"},{"line_number":112,"context_line":"                                              attributes.ATTR_NOT_SPECIFIED) !\u003d"},{"line_number":113,"context_line":"                                 attributes.ATTR_NOT_SPECIFIED))"},{"line_number":114,"context_line":"        r \u003d self._get_router(context, id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_fea2a3fb","line":111,"updated":"2014-08-20 21:25:09.000000000","message":"payload, and r_update are not needed if \"not r.extra_attributes.distributed\".  You should wait to set these until we know that we have a distributed router.  See my note on L107.\n\n(update: If there is some reason you need to set this before calling super then okay.  You can still use the approach in my L107 comment and move this above.  I couldn\u0027t see a reason for that though.) \n\nAlso, no need for double parentheses here.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                                 attributes.ATTR_NOT_SPECIFIED))"},{"line_number":114,"context_line":"        r \u003d self._get_router(context, id)"},{"line_number":115,"context_line":"        if r.extra_attributes.distributed:"},{"line_number":116,"context_line":"            # For distributed router update, we will call update_router()"},{"line_number":117,"context_line":"            # method of L3_NAT_dbonly_mixin class which will update the DB"},{"line_number":118,"context_line":"            # and will trigger router schedule. The rpc notification"},{"line_number":119,"context_line":"            # for router update will be sent from here."}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_43c16d7f","line":116,"updated":"2014-08-18 17:28:44.000000000","message":"this NOTE is confusing to me: is this saying that it is okay to send an update here and subsequent updates in line 128? Or is it saying that we should avoid sending the message here? From Vivek\u0027s comment it sounds like it\u0027s the latter.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"b4004f149cb98b038256d904c0cfbb84958d545f","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            # method of L3_NAT_dbonly_mixin class which will update the DB"},{"line_number":118,"context_line":"            # and will trigger router schedule. The rpc notification"},{"line_number":119,"context_line":"            # for router update will be sent from here."},{"line_number":120,"context_line":"            router_db \u003d (super(l3_db.L3_NAT_db_mixin, self)."},{"line_number":121,"context_line":"                         update_router(context, id, router))"},{"line_number":122,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":123,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_dae64f16","line":120,"updated":"2014-08-18 11:02:31.000000000","message":"This line is tricky.  But this is OK to address the update_router case.\r\n\r\nWe need to address unnecessary coupling of scheduling and notification in a separate patch set later.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"c00073afaa2b8be035f2e0f507fcbe1836d62416","unresolved":false,"context_lines":[{"line_number":117,"context_line":"            # method of L3_NAT_dbonly_mixin class which will update the DB"},{"line_number":118,"context_line":"            # and will trigger router schedule. The rpc notification"},{"line_number":119,"context_line":"            # for router update will be sent from here."},{"line_number":120,"context_line":"            router_db \u003d (super(l3_db.L3_NAT_db_mixin, self)."},{"line_number":121,"context_line":"                         update_router(context, id, router))"},{"line_number":122,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":123,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_91311d0e","line":120,"in_reply_to":"1abeadc6_dae64f16","updated":"2014-08-18 12:11:30.000000000","message":"Can we create a TODO or bug to address this. The call is tricky indeed!","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            router_db \u003d (super(l3_db.L3_NAT_db_mixin, self)."},{"line_number":121,"context_line":"                         update_router(context, id, router))"},{"line_number":122,"context_line":"            l3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin"},{"line_number":123,"context_line":"            subnet_ids \u003d l3_dvr_mixin.get_subnet_ids_on_router(self,"},{"line_number":124,"context_line":"                                                               context,"},{"line_number":125,"context_line":"                                                               id)"},{"line_number":126,"context_line":"            for subnet in subnet_ids:"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_63902996","line":123,"updated":"2014-08-18 17:28:44.000000000","message":"you don\u0027t need: \n\nl3_dvr_mixin \u003d l3_dvrsched_db.L3_DVRsch_db_mixin\n\nthis can be, simply:\n\nself.get_subnet_ids_on_router(context, id)\n\nPlease remove line 122","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":128,"context_line":"                self.l3_rpc_notifier.routers_updated(context, [id],"},{"line_number":129,"context_line":"                                                     None, payload)"},{"line_number":130,"context_line":"        else:"},{"line_number":131,"context_line":"            router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self)."},{"line_number":132,"context_line":"                         update_router(context, id, router))"},{"line_number":133,"context_line":"        return router_db"},{"line_number":134,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_a337a1af","line":131,"updated":"2014-08-18 17:28:44.000000000","message":"the structure of the code could be much simpler if you did:\n\n        r_update \u003d router[\u0027router\u0027]\n        payload \u003d { ... }\n        r \u003d self._get_router(context, id)\n        router_db \u003d (super(L3_NAT_with_dvr_db_mixin, self).\n                         update_router(context, id, router))\n        if r.extra_attributes.distributed:\n            subnet_ids \u003d self.get_subnet_ids_on_router(context, id)\n            for subnet in subnet_ids:\n                payload[\u0027subnet_id\u0027] \u003d subnet\n                self.l3_rpc_notifier.routers_updated(context, [id],\n                                                     None, payload)\n        return router_db","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"}],"neutron/tests/unit/db/test_l3_dvr_db.py":[{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"70f2051f99c3a7b83a0299686e3ed4ffd96bb068","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(rdb, router_db)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_15a8cad7","line":198,"updated":"2014-08-12 05:12:53.000000000","message":"Your testcase should check whether for each subnet the routers_updated is called as that is the only value add in the overridden update_router method.\r\n\r\nChecking whether the updated router is a distributed router does not help as you are feeding the distributed router \u0027id\u0027 itself as input to update_router method here.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"change_message_id":"76527172535317aa3eb13f97f02d8b03fdd41036","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(rdb, router_db)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_cc5a7650","line":198,"updated":"2014-08-11 10:03:11.000000000","message":"nit: expected result goes first","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"0b42fc7f3b88419c6267b1c4f02f6afb7d3c13f2","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(rdb, router_db)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_8c20504c","line":198,"in_reply_to":"baada198_15a8cad7","updated":"2014-08-12 09:44:11.000000000","message":"As part of UT writing I wanted to ensure that update_router() method in L3_NAT_with_dvr_db_mixin class actually iterates the for loop for number of subnet and invokes in the RPC routers_updated() call. To do this I am passing the mocked subnet ID to achieve the goal.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"d2db58e00d84e6018243b7fbb017c4f6b9d72033","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(rdb, router_db)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_f761b711","line":198,"in_reply_to":"baada198_cc5a7650","updated":"2014-08-12 06:29:10.000000000","message":"Got it, you mean self.assertEqual(router_db, rdb). I will change the same in my next patch.","commit_id":"629b9f44069ed2b7aacde88358a77c45df9a2433"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                self.ctx, router_id, router_db, mock.ANY)"},{"line_number":173,"context_line":"            self.assertFalse(cs.call_count)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def test__update_router(self):"},{"line_number":176,"context_line":"        mock_sub_id \u003d uuidutils.generate_uuid()"},{"line_number":177,"context_line":"        subnet_ids \u003d set()"},{"line_number":178,"context_line":"        subnet_ids.add(str(mock_sub_id))"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_2f128fb3","line":175,"updated":"2014-08-13 15:25:23.000000000","message":"this name is too generic, imo, what are you \u0027verifying\u0027 exactly?","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                self.ctx, router_id, router_db, mock.ANY)"},{"line_number":173,"context_line":"            self.assertFalse(cs.call_count)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def test__update_router(self):"},{"line_number":176,"context_line":"        mock_sub_id \u003d uuidutils.generate_uuid()"},{"line_number":177,"context_line":"        subnet_ids \u003d set()"},{"line_number":178,"context_line":"        subnet_ids.add(str(mock_sub_id))"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_cd967849","line":175,"in_reply_to":"baada198_2f128fb3","updated":"2014-08-13 17:08:20.000000000","message":"Agreed, I can write two method/test functions by name test__distributed_update_router() and test__non_distributed_update_router() to ensure that if and else case of update_router() method in class L3_NAT_with_dvr_db_mixin are tested.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def test__update_router(self):"},{"line_number":176,"context_line":"        mock_sub_id \u003d uuidutils.generate_uuid()"},{"line_number":177,"context_line":"        subnet_ids \u003d set()"},{"line_number":178,"context_line":"        subnet_ids.add(str(mock_sub_id))"},{"line_number":179,"context_line":"        router \u003d {"},{"line_number":180,"context_line":"            \u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":181,"context_line":"            \u0027admin_state_up\u0027: True,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0f26ab22","line":178,"updated":"2014-08-13 15:25:23.000000000","message":"why are you doing this? You could simply use fake string uuids, the outcome of the testcase is the same.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def test__update_router(self):"},{"line_number":176,"context_line":"        mock_sub_id \u003d uuidutils.generate_uuid()"},{"line_number":177,"context_line":"        subnet_ids \u003d set()"},{"line_number":178,"context_line":"        subnet_ids.add(str(mock_sub_id))"},{"line_number":179,"context_line":"        router \u003d {"},{"line_number":180,"context_line":"            \u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":181,"context_line":"            \u0027admin_state_up\u0027: True,"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_6d764c42","line":178,"in_reply_to":"baada198_0f26ab22","updated":"2014-08-13 17:08:20.000000000","message":"Agreed, I can simply have a string saying \"fake_subnet_id\" instead of generating a UUID.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(router_db, rdb)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0f74eb02","line":198,"updated":"2014-08-13 15:25:23.000000000","message":"You\u0027d want to verify that certain calls are made, checking that what you created is returned does not ensure correctness of your change.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a4d3c478bef5bad5c3d41db0ba7085f9685685ea","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(router_db, rdb)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_9064934e","line":198,"in_reply_to":"baada198_0db6b0db","updated":"2014-08-13 17:38:27.000000000","message":"I am saying that you should be verifying that your fix of calling get_subnet_ids_on_router is working. A test needs to be written in a way that breaks without the correctly functionality and it passes with.\n\nI suspect your test will pass even without your changes.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(router_db, rdb)"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_0db6b0db","line":198,"in_reply_to":"baada198_0f74eb02","updated":"2014-08-13 17:08:20.000000000","message":"The assumption was to test the update_router()\u0027s each statement by mocking the external function calls.\nAssuming that external functions will return the the correct set of values. So I mocked the external dependencies.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"624371143235c5666143ae809f12078fb9cd1cd6","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"},{"line_number":196,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":197,"context_line":"            rdb \u003d self.mixin.update_router(self.ctx, router_id, mock.ANY)"},{"line_number":198,"context_line":"            self.assertEqual(router_db, rdb)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_e15fdf70","line":198,"in_reply_to":"baada198_9064934e","updated":"2014-08-15 04:08:02.000000000","message":"I will address your comment by deciding the test case success and failure based on number of time routers_updated() method is called. For distributed router case I will pass two subnet ids so that routers_updated() is called twice. Where as for non distributed case I am expecting that super call will make call to routers_updated() only once.\nFor get_subnet_ids_on_router() method\u0027s correctness there is already a test function available in file test_l3_schedulers.py file.","commit_id":"3312100fb8379453b2f5ab60b87cf89c9c7be3a3"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"1d04f21b33a81235a64e221ebb6e7cf14f4bb676","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        router_update \u003d {\u0027router\u0027: {\u0027external_gateway_info\u0027: True}}"},{"line_number":190,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":191,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":192,"context_line":"        self.assertEqual(True, router_db.extra_attributes.distributed)"},{"line_number":193,"context_line":"        with contextlib.nested("},{"line_number":194,"context_line":"            mock.patch.object(l3_db.L3_NAT_db_mixin,"},{"line_number":195,"context_line":"                              \u0027_get_router\u0027, return_value\u003drouter_db),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ac7a964_a03f6824","line":192,"updated":"2014-08-15 15:34:17.000000000","message":"assertTrue()","commit_id":"17d1f609633334559ac401986f94ac399e9a8b6d"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"e47e87c00e8085a8331c9b4982267111c7baf45b","unresolved":false,"context_lines":[{"line_number":189,"context_line":"        router_update \u003d {\u0027router\u0027: {\u0027external_gateway_info\u0027: True}}"},{"line_number":190,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":191,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":192,"context_line":"        self.assertEqual(True, router_db.extra_attributes.distributed)"},{"line_number":193,"context_line":"        with contextlib.nested("},{"line_number":194,"context_line":"            mock.patch.object(l3_db.L3_NAT_db_mixin,"},{"line_number":195,"context_line":"                              \u0027_get_router\u0027, return_value\u003drouter_db),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ac7a964_616e3203","line":192,"in_reply_to":"7ac7a964_a03f6824","updated":"2014-08-15 16:53:45.000000000","message":"Addressed.","commit_id":"17d1f609633334559ac401986f94ac399e9a8b6d"},{"author":{"_account_id":6659,"name":"Paul Michali","email":"pc@michali.net","username":"pcm"},"change_message_id":"1d04f21b33a81235a64e221ebb6e7cf14f4bb676","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        router_update \u003d {\u0027router\u0027: {\u0027external_gateway_info\u0027: True}}"},{"line_number":214,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":215,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":216,"context_line":"        self.assertEqual(False, router_db.extra_attributes.distributed)"},{"line_number":217,"context_line":"        with contextlib.nested("},{"line_number":218,"context_line":"            mock.patch.object(l3_db.L3_NAT_db_mixin,"},{"line_number":219,"context_line":"                              \u0027_get_router\u0027, return_value\u003drouter_db),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ac7a964_407db4e6","line":216,"updated":"2014-08-15 15:34:17.000000000","message":"assertFalse()","commit_id":"17d1f609633334559ac401986f94ac399e9a8b6d"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"e47e87c00e8085a8331c9b4982267111c7baf45b","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        router_update \u003d {\u0027router\u0027: {\u0027external_gateway_info\u0027: True}}"},{"line_number":214,"context_line":"        router_db \u003d self._create_router(router)"},{"line_number":215,"context_line":"        router_id \u003d router_db[\u0027id\u0027]"},{"line_number":216,"context_line":"        self.assertEqual(False, router_db.extra_attributes.distributed)"},{"line_number":217,"context_line":"        with contextlib.nested("},{"line_number":218,"context_line":"            mock.patch.object(l3_db.L3_NAT_db_mixin,"},{"line_number":219,"context_line":"                              \u0027_get_router\u0027, return_value\u003drouter_db),"}],"source_content_type":"text/x-python","patch_set":11,"id":"7ac7a964_a1776ad3","line":216,"in_reply_to":"7ac7a964_407db4e6","updated":"2014-08-15 16:53:45.000000000","message":"Addressed.","commit_id":"17d1f609633334559ac401986f94ac399e9a8b6d"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    def test__distributed_update_router(self):"},{"line_number":181,"context_line":"        subnet_ids \u003d set()"},{"line_number":182,"context_line":"        subnet_ids.add(\u0027fake_subnet_id_1\u0027)"},{"line_number":183,"context_line":"        subnet_ids.add(\u0027fake_subnet_id_2\u0027)"},{"line_number":184,"context_line":"        router \u003d {"},{"line_number":185,"context_line":"            \u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":186,"context_line":"            \u0027admin_state_up\u0027: True,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_83a7054f","line":183,"updated":"2014-08-18 17:28:44.000000000","message":"you can do more succinctly:\n\nsubnet_ids \u003d set([\u0027fake_subnet_id_1\u0027, \u0027fake_subnet_id_2\u0027])","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                              \u0027_get_router\u0027, return_value\u003drouter_db),"},{"line_number":196,"context_line":"            mock.patch.object(l3_dvr_db.l3_db.L3_NAT_dbonly_mixin,"},{"line_number":197,"context_line":"                              \u0027update_router\u0027, return_value\u003drouter_db),"},{"line_number":198,"context_line":"            mock.patch.object(l3_dvrscheduler_db.L3_DVRsch_db_mixin,"},{"line_number":199,"context_line":"                              \u0027get_subnet_ids_on_router\u0027,"},{"line_number":200,"context_line":"                              return_value\u003dsubnet_ids),"},{"line_number":201,"context_line":"            mock.patch.object(l3_rpc_agent_api.L3AgentNotifyAPI,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_431ded0e","line":198,"updated":"2014-08-18 17:28:44.000000000","message":"To address my previous comment you\u0027d need to add get_subnet_ids_on_router to the mixin. You can do so with:\n\nsetattr(self.mixin, \u0027get_subnet_ids_on_router\u0027, lambda self, context: subnet_ids)\n\nbefore the with statement. You can then remove like 198 and revise line 202.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":202,"context_line":"                              \u0027routers_updated\u0027)) as (gr, ur, gs, ru):"},{"line_number":203,"context_line":"            self.mixin.update_router(self.ctx, router_id, router_update)"},{"line_number":204,"context_line":"            # expecting routers_updated() to be called for each subnet"},{"line_number":205,"context_line":"            self.assertEqual(2, ru.call_count)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def test__non_distributed_update_router(self):"},{"line_number":208,"context_line":"        router \u003d {"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_2302b13e","line":205,"updated":"2014-08-18 17:28:44.000000000","message":"this assert is a bit lame. You should verify that you get the expected calls.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"77838e43d805962f8ec147a7104a2ccc0f8d7be4","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            # expecting routers_updated() to be called for each subnet"},{"line_number":205,"context_line":"            self.assertEqual(2, ru.call_count)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def test__non_distributed_update_router(self):"},{"line_number":208,"context_line":"        router \u003d {"},{"line_number":209,"context_line":"            \u0027name\u0027: \u0027foo_router\u0027,"},{"line_number":210,"context_line":"            \u0027admin_state_up\u0027: True,"}],"source_content_type":"text/x-python","patch_set":12,"id":"1abeadc6_63e589a7","line":207,"updated":"2014-08-18 17:28:44.000000000","message":"do not repeat yourself. The only diff between this and the previous testcase is the distributed flag. You either use a helper function or you get rid of this testcase altogether.","commit_id":"ae04dc14295f07a8c77d6dd501c04e429040a23b"}],"neutron/tests/unit/test_l3_plugin.py":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"4b2b955f1667ab1f6d9e9eb11b228d17b0d236bc","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_6f5ac783","side":"PARENT","line":291,"updated":"2014-08-13 15:25:23.000000000","message":"why is this being removed? You\u0027re reducing the existing coverage.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"af4756c5659d586aa423a8fdb6af9738b949ad36","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"7ac7a964_8a3c8d95","side":"PARENT","line":291,"in_reply_to":"baada198_10608333","updated":"2014-08-14 07:48:02.000000000","message":"Earlier insertion of L3_NAT_with_dvr_db_mixin into vanilla test_l3_plugin , in addition to L3_NAT_db_mixn, was causing circular references.   \r\n\r\nWe removed that knot.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"},{"author":{"_account_id":9361,"name":"Vivekanandan Narasimhan","email":"n.vivekanandan@ericsson.com","username":"viveknarasimhan"},"change_message_id":"8d17ebf74df1e182fd65b39c5f96f6f737bd1ad9","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_da42af3a","side":"PARENT","line":291,"in_reply_to":"baada198_6f5ac783","updated":"2014-08-13 15:33:37.000000000","message":"test_l3_plugin was to support existing traditional router and its testcases.\r\n\r\nAll extensions have created their own test file with their own extended test plugins.  \r\n\r\nFurther TestL3NatServicePlugin broke Jenkins runs for the patchset.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"a4d3c478bef5bad5c3d41db0ba7085f9685685ea","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_10608333","side":"PARENT","line":291,"in_reply_to":"baada198_8dbba00f","updated":"2014-08-13 17:38:27.000000000","message":"I suspect this is because you\u0027re causing a needless circular reference. I\u0027d need to look into this more deeply.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"41744b5800cf0cb80f3a1b14d33c6f40e45fb010","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_dafaafb9","side":"PARENT","line":291,"in_reply_to":"baada198_da42af3a","updated":"2014-08-13 15:35:57.000000000","message":"if it broke the test there must be a good reason for it, I find that removed it is rather questionable. I\u0027d like to explore what the failure is, I fear there\u0027s something more subtle.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"},{"author":{"_account_id":10760,"name":"Vinod Kumar","email":"vinod.kumar5@hpe.com","username":"kvinod"},"change_message_id":"02704ef9d0f1512c1b52b555a6aa76bdd4921707","unresolved":false,"context_lines":[{"line_number":288,"context_line":"# A L3 routing service plugin class for tests with plugins that"},{"line_number":289,"context_line":"# delegate away L3 routing functionality"},{"line_number":290,"context_line":"class TestL3NatServicePlugin(common_db_mixin.CommonDbMixin,"},{"line_number":291,"context_line":"                             l3_dvr_db.L3_NAT_with_dvr_db_mixin,"},{"line_number":292,"context_line":"                             l3_db.L3_NAT_db_mixin):"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    supported_extension_aliases \u003d [\"router\"]"}],"source_content_type":"text/x-python","patch_set":9,"id":"baada198_8dbba00f","side":"PARENT","line":291,"in_reply_to":"baada198_dafaafb9","updated":"2014-08-13 17:08:20.000000000","message":"The test case were failing because we are deriving both the classes L3_NAT_with_dvr_db_mixin and L3_NAT_db_mixin, and if you see L3_NAT_with_dvr_db_mixin itself is deriving L3_NAT_db_mixin. Also, as Vivek said the these test function was written to test the traditional router.","commit_id":"e2c72495f4cacbafb650fb1e429ea68ba8c07836"}]}
