)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2967,"name":"ljjjustin","email":"iamljj@gmail.com","username":"ljjjustin"},"unresolved":false,"context_lines":[{"line_number":16,"context_line":"qrouter namespaces a L3 agent instance recognizes and to"},{"line_number":17,"context_line":"destroy those it does not know about."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Bug #1175695"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Change-Id: Idae77886bd195d773878c3d212ccfd56269216fb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"AAAATn%2F%2FXfM%3D","line":19,"updated":"2013-11-08 04:30:09.000000000","message":"Closes-bug: #1175695","commit_id":"0252f4ed6cf6dc9637d516dc1348baa948392a31"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a L3 agent controlling multiple qrouter namespaces"},{"line_number":10,"context_line":"restarts, it destroys all qrouter namespaces even if"},{"line_number":11,"context_line":"some of them are still n use.  As a result, network"},{"line_number":12,"context_line":"traffic could be stopped on the VMs that use the"},{"line_number":13,"context_line":"networks associated with these namespaces."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"AAAATn%2F%2FU3Q%3D","line":11,"updated":"2013-11-10 18:28:34.000000000","message":"still in use","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When a L3 agent controlling multiple qrouter namespaces"},{"line_number":10,"context_line":"restarts, it destroys all qrouter namespaces even if"},{"line_number":11,"context_line":"some of them are still n use.  As a result, network"},{"line_number":12,"context_line":"traffic could be stopped on the VMs that use the"},{"line_number":13,"context_line":"networks associated with these namespaces."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"AAAATn%2F%2FOiY%3D","line":11,"in_reply_to":"AAAATn%2F%2FU3Q%3D","updated":"2013-11-12 16:01:11.000000000","message":"Done","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"}],"neutron/agent/l3_agent.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":246,"context_line":"            if ns_only_router_id in router_namespaces:"},{"line_number":247,"context_line":"                ns_list.append(ns_only_router_id)"},{"line_number":248,"context_line":"        elif ids_to_ignore:"},{"line_number":249,"context_line":"            for ns in router_namespaces:"},{"line_number":250,"context_line":"                if (ns[len(NS_PREFIX):] not in ids_to_ignore):"},{"line_number":251,"context_line":"                    ns_list.append(ns)"},{"line_number":252,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAP3%2F%2Fqco%3D","line":249,"updated":"2013-07-15 01:40:03.000000000","message":"prefix_len \u003d len(NS_PREFIX)\nns_list.extend(\n    ns for ns router_namespaces if ns[prefix_len:] not in ids_to_ignore\n)","commit_id":"788a7a92debbcf19abc7020872e7bd618fb1c358"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        ids_to_ignore is a list of router IDs whose namespaces should be"},{"line_number":235,"context_line":"        preserved across a restart. The reason is that running VMs may still"},{"line_number":236,"context_line":"        have ports using these namespaces."},{"line_number":237,"context_line":"        \"\"\""},{"line_number":238,"context_line":"        root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":239,"context_line":"        host_namespaces \u003d root_ip.get_namespaces(self.root_helper)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAQn%2F%2FiUA%3D","line":236,"updated":"2013-07-29 16:16:47.000000000","message":"There is one edge case here.  If somehow this method were called with only_router_id \u003d \u0027some router id\u0027 *and* \u0027some router id\u0027 is found in ids_to_ignore then the latter will be ignored.\n\nI think this behavior is fine but I think that it warrants mentioning in the doc string somewhere above that there is a defined precedence.","commit_id":"061ce7ef9d1c2887f593fee4ec3b3e6038d7731c"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        ids_to_ignore is a list of router IDs whose namespaces should be"},{"line_number":235,"context_line":"        preserved across a restart. The reason is that running VMs may still"},{"line_number":236,"context_line":"        have ports using these namespaces."},{"line_number":237,"context_line":"        \"\"\""},{"line_number":238,"context_line":"        root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":239,"context_line":"        host_namespaces \u003d root_ip.get_namespaces(self.root_helper)"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAQn%2F%2FeQM%3D","line":236,"in_reply_to":"AAAAQn%2F%2FiUA%3D","updated":"2013-07-30 16:37:36.000000000","message":"Done","commit_id":"061ce7ef9d1c2887f593fee4ec3b3e6038d7731c"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":210,"context_line":"        self.removed_routers \u003d set()"},{"line_number":211,"context_line":"        self.sync_progress \u003d False"},{"line_number":212,"context_line":"        if self.conf.use_namespaces:"},{"line_number":213,"context_line":"            router_ids \u003d None"},{"line_number":214,"context_line":"            if self.conf.router_id is None:"},{"line_number":215,"context_line":"                try:"},{"line_number":216,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2Fd6w%3D","line":213,"updated":"2013-07-30 18:08:57.000000000","message":"I prefer this part to be one helper function.","commit_id":"31601f0ec29563bc4e0bfc5f6f974616741997df"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":210,"context_line":"        self.removed_routers \u003d set()"},{"line_number":211,"context_line":"        self.sync_progress \u003d False"},{"line_number":212,"context_line":"        if self.conf.use_namespaces:"},{"line_number":213,"context_line":"            router_ids \u003d None"},{"line_number":214,"context_line":"            if self.conf.router_id is None:"},{"line_number":215,"context_line":"                try:"},{"line_number":216,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2FU0s%3D","line":213,"in_reply_to":"AAAAQn%2F%2Fd6w%3D","updated":"2013-08-01 23:21:29.000000000","message":"I followed your idea of the cleanup routine that determines the namespaces to be destroyed and have the _destroy_router_namespaces route destroys each namespace in the list passed from cleanup.","commit_id":"31601f0ec29563bc4e0bfc5f6f974616741997df"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _destroy_router_namespaces(self, only_router_id\u003dNone,"},{"line_number":242,"context_line":"                                   ids_to_ignore\u003dNone):"},{"line_number":243,"context_line":"        \"\"\"Destroy router namespaces on the host to eliminate all stale"},{"line_number":244,"context_line":"        linux devices, iptables rules, and namespaces."}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2Fd3w%3D","line":241,"updated":"2013-07-30 18:08:57.000000000","message":"This method really get hard to read...\nHow about\n\nhttps://gist.github.com/nati/6115314 ?","commit_id":"31601f0ec29563bc4e0bfc5f6f974616741997df"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":238,"context_line":""},{"line_number":239,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _destroy_router_namespaces(self, only_router_id\u003dNone,"},{"line_number":242,"context_line":"                                   ids_to_ignore\u003dNone):"},{"line_number":243,"context_line":"        \"\"\"Destroy router namespaces on the host to eliminate all stale"},{"line_number":244,"context_line":"        linux devices, iptables rules, and namespaces."}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAQn%2F%2FUn0%3D","line":241,"in_reply_to":"AAAAQn%2F%2Fd3w%3D","updated":"2013-08-01 23:21:29.000000000","message":"Implemented.","commit_id":"31601f0ec29563bc4e0bfc5f6f974616741997df"},{"author":{"_account_id":1038,"name":"Jack McCann","username":"jack-mccann"},"unresolved":false,"context_lines":[{"line_number":236,"context_line":"                             if ns.startswith(NS_PREFIX)]"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"        ns_list \u003d []"},{"line_number":239,"context_line":"        if self.conf.router_id:"},{"line_number":240,"context_line":"            ns_only_router_id \u003d NS_PREFIX + self.conf.router_id"},{"line_number":241,"context_line":"            if ns_only_router_id in router_namespaces:"},{"line_number":242,"context_line":"                ns_list \u003d [ns_only_router_id]"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAQ3%2F%2F8a4%3D","line":239,"updated":"2013-08-12 17:48:20.000000000","message":"The intent of this change is to preserve router namespaces that are still valid and in-use, so that a restart of the l3 agent does not cause a communication outage while the namespaces are being torn down and rebuilt.\n\nIf self.conf.router_id is set, we would want to preserve the associated namespace if it exists, rather than tearing it down and rebuilding it.  So if router_id is set, do nothing.  The doc string above will need to be modified to reflect this change.","commit_id":"2a830c8c8489a5a131e320537953373dfe111f86"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":239,"context_line":"        if self.conf.router_id:"},{"line_number":240,"context_line":"            ns_only_router_id \u003d NS_PREFIX + self.conf.router_id"},{"line_number":241,"context_line":"            if ns_only_router_id in router_namespaces:"},{"line_number":242,"context_line":"                ns_list \u003d [ns_only_router_id]"},{"line_number":243,"context_line":"        else:"},{"line_number":244,"context_line":"            ids_to_ignore \u003d []"},{"line_number":245,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAQn%2F%2B9Rw%3D","line":242,"updated":"2013-08-09 10:33:04.000000000","message":"At this stage, why don\u0027t destroy just this namespace - and spare the get_routers call over rpc which is fairly expensive.\n\nany l3 namespace which does not belong to any router known to neutron, ie: the ones which will be destroyed, might be cleaned up witht the external utility.","commit_id":"2a830c8c8489a5a131e320537953373dfe111f86"},{"author":{"_account_id":1038,"name":"Jack McCann","username":"jack-mccann"},"unresolved":false,"context_lines":[{"line_number":239,"context_line":"        if self.conf.router_id:"},{"line_number":240,"context_line":"            ns_only_router_id \u003d NS_PREFIX + self.conf.router_id"},{"line_number":241,"context_line":"            if ns_only_router_id in router_namespaces:"},{"line_number":242,"context_line":"                ns_list \u003d [ns_only_router_id]"},{"line_number":243,"context_line":"        else:"},{"line_number":244,"context_line":"            ids_to_ignore \u003d []"},{"line_number":245,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAQ3%2F%2F8ag%3D","line":242,"in_reply_to":"AAAAQn%2F%2B9Rw%3D","updated":"2013-08-12 17:48:20.000000000","message":"Hi Salvatore.\n\nI don\u0027t quite follow your comment about sparing the get_routers call, get_routers is not called in case where router_id is set.\n\nRegarding the namespace cleanup utility, maybe I\u0027m not quite understanding you there either, but it looks like quantum-netns-cleanup will only clean namespaces where all the network devices have been deleted.  So it seems to me that we either need to go through _destroy_router_namespace for unknown routers here, or move it to the cleanup utility.","commit_id":"2a830c8c8489a5a131e320537953373dfe111f86"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":226,"context_line":"        init.  This only makes sense if router_id is set."},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"        If router_id is undefined, then all router namespaces existing on"},{"line_number":229,"context_line":"        the host, excluding those the agent knows about, will be destroyed."},{"line_number":230,"context_line":"        \"\"\""},{"line_number":231,"context_line":"        root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":232,"context_line":"        host_namespaces \u003d root_ip.get_namespaces(self.root_helper)"}],"source_content_type":"text/x-python","patch_set":15,"id":"AAAARH%2F%2F7D4%3D","line":229,"updated":"2013-08-15 05:49:24.000000000","message":"Need to revise the function description.","commit_id":"7d48bdbc6806e476a336eb088090b7335af06f91"},{"author":{"_account_id":1038,"name":"Jack McCann","username":"jack-mccann"},"unresolved":false,"context_lines":[{"line_number":249,"context_line":"                                    \"info for namespace clean-up.\"))"},{"line_number":250,"context_line":"            except Exception:"},{"line_number":251,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":252,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"            prefix_len \u003d len(NS_PREFIX)"},{"line_number":255,"context_line":"            ns_list \u003d [ns for ns in router_namespaces"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAARH%2F%2F1lM%3D","line":252,"updated":"2013-08-16 14:18:26.000000000","message":"Since the intent of this change is to preserve in-use namespaces, I think if there is an exception from get_routers, we should just log the exception and return without destroying any namespaces.  Right now, if there is exception, we will destroy all namespaces including the ones we want to preserve.  This will also let you simplify the exception handling, you could remove lines 242-249 and just have one generic exception handler.","commit_id":"efcdc994b75858814cbc9e5d490b1d4144e38eb3"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":249,"context_line":"                                    \"info for namespace clean-up.\"))"},{"line_number":250,"context_line":"            except Exception:"},{"line_number":251,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":252,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"            prefix_len \u003d len(NS_PREFIX)"},{"line_number":255,"context_line":"            ns_list \u003d [ns for ns in router_namespaces"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAARH%2F%2FzBU%3D","line":252,"in_reply_to":"AAAARH%2F%2F1lM%3D","updated":"2013-08-17 12:12:10.000000000","message":"Done","commit_id":"efcdc994b75858814cbc9e5d490b1d4144e38eb3"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":242,"context_line":""},{"line_number":243,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":244,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":245,"context_line":"                ids_to_ignore \u003d [r[\u0027id\u0027] for r in routers]"},{"line_number":246,"context_line":"            except Exception:"},{"line_number":247,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":248,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAARn%2F%2F9B4%3D","line":245,"updated":"2013-08-19 19:19:14.000000000","message":"Kind of a nit but might be worth considering:  \n\nhost_namespaces and router_namespaces above contain names that include the prefix.  The code would read a bit better if ids_to_ignore also had the prefixes for consistency.  Maybe call it routers_to_ignore instead.\n\nIf you wrapped them in sets then the code below could be simplified.","commit_id":"549b7bca470e49bcb000ddd213d202055f209ff4"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":242,"context_line":""},{"line_number":243,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":244,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":245,"context_line":"                ids_to_ignore \u003d [r[\u0027id\u0027] for r in routers]"},{"line_number":246,"context_line":"            except Exception:"},{"line_number":247,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":248,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAASn%2F%2F0v0%3D","line":245,"in_reply_to":"AAAARn%2F%2F9B4%3D","updated":"2013-08-29 04:21:23.000000000","message":"+1 simplified code","commit_id":"549b7bca470e49bcb000ddd213d202055f209ff4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":246,"context_line":"            except Exception:"},{"line_number":247,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":248,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":249,"context_line":"            else:"},{"line_number":250,"context_line":"                prefix_len \u003d len(NS_PREFIX)"},{"line_number":251,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":252,"context_line":"                           if ns[prefix_len:] not in ids_to_ignore]"}],"source_content_type":"text/x-python","patch_set":17,"id":"AAAARn%2F%2F9BE%3D","line":249,"updated":"2013-08-19 19:19:14.000000000","message":"With the comment above, this code would be something like this:\n\nself._destroy_router_namespaces(router_namespaces - routers_to_ignore)","commit_id":"549b7bca470e49bcb000ddd213d202055f209ff4"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        super(L3NATAgent, self).__init__(conf\u003dself.conf)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def _cleanup_namespaces(self):"},{"line_number":220,"context_line":"        \"\"\"Destroy router namespaces on the host to eliminate all stale"},{"line_number":221,"context_line":"        linux devices, iptables rules, and namespaces."},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        If the router_id parameter is set in l3_agent.ini, no router"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq9g%3D","line":220,"updated":"2013-08-31 09:50:51.000000000","message":"I think this sentence needs to be updated according to the new logic","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":234,"context_line":"                root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                host_namespaces \u003d root_ip.get_namespaces(self.root_helper)"},{"line_number":237,"context_line":"                router_namespaces \u003d [ns for ns in host_namespaces"},{"line_number":238,"context_line":"                                     if ns.startswith(NS_PREFIX)]"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FqZo%3D","line":237,"updated":"2013-08-31 21:12:48.000000000","message":"This should be a set so that you can use set math to determine routers to destroy later.\n\nrouter_namespaces \u003d set(\n   ns for ns in host_namespaces\n    if ns.startswith(NS_PREFIX)\n)","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":234,"context_line":"                root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"                host_namespaces \u003d root_ip.get_namespaces(self.root_helper)"},{"line_number":237,"context_line":"                router_namespaces \u003d [ns for ns in host_namespaces"},{"line_number":238,"context_line":"                                     if ns.startswith(NS_PREFIX)]"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fpro%3D","line":237,"in_reply_to":"AAAASn%2F%2FqZo%3D","updated":"2013-09-01 13:47:32.000000000","message":"I will switch to use sets instead of lists even though there won\u0027t be any duplicate router namespace names on a host.","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FqZk%3D","line":242,"updated":"2013-08-31 21:12:48.000000000","message":"router_ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fprk%3D","line":242,"in_reply_to":"AAAASn%2F%2FqZk%3D","updated":"2013-09-01 13:47:32.000000000","message":"Done","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq9Q%3D","line":243,"updated":"2013-08-31 09:50:51.000000000","message":"nit: could have used:\n ns_list\u003d set(router_namespaces) - set(routers_to_ignore)\nalthough it would be a set then, but iterable in the same way","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":240,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq0E%3D","line":243,"in_reply_to":"AAAASn%2F%2Fq9Q%3D","updated":"2013-08-31 14:05:28.000000000","message":"I will just leave it as it is.","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FqZs%3D","line":244,"updated":"2013-08-31 21:12:48.000000000","message":"ns_to_destroy \u003d router_namespaces - router_ns_to_ignore","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":241,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":242,"context_line":"                routers_to_ignore \u003d [NS_PREFIX + r[\u0027id\u0027] for r in routers]"},{"line_number":243,"context_line":"                ns_list \u003d [ns for ns in router_namespaces"},{"line_number":244,"context_line":"                           if ns not in routers_to_ignore]"},{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fprg%3D","line":244,"in_reply_to":"AAAASn%2F%2FqZs%3D","updated":"2013-09-01 13:47:32.000000000","message":"Done","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":248,"context_line":"            else:"},{"line_number":249,"context_line":"                self._destroy_router_namespaces(ns_list)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _destroy_router_namespaces(self, router_namespaces):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq9U%3D","line":248,"updated":"2013-08-31 09:50:51.000000000","message":"why else: ? _destroy_router_namespaces can be added under try block","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":245,"context_line":"            except Exception:"},{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":248,"context_line":"            else:"},{"line_number":249,"context_line":"                self._destroy_router_namespaces(ns_list)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _destroy_router_namespaces(self, router_namespaces):"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq0c%3D","line":248,"in_reply_to":"AAAASn%2F%2Fq9U%3D","updated":"2013-08-31 14:05:28.000000000","message":"This is to show that the exception handling is only for catching exception that can occur when retrieving the router names.  And that exceptions from _destroy_router_namespaces are handled inside the routine itself.  The _destroy_router_namespaces routine should not quit when destroying one of the router hit an error.","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":248,"context_line":"            else:"},{"line_number":249,"context_line":"                self._destroy_router_namespaces(ns_list)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _destroy_router_namespaces(self, router_namespaces):"},{"line_number":252,"context_line":"        \"\"\"Destroys all namespaces in the router_namespaces list.\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FqZg%3D","line":249,"updated":"2013-08-31 21:12:48.000000000","message":"elf._destroy_router_namespaces(ns_to_destroy)","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":246,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":247,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":248,"context_line":"            else:"},{"line_number":249,"context_line":"                self._destroy_router_namespaces(ns_list)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _destroy_router_namespaces(self, router_namespaces):"},{"line_number":252,"context_line":"        \"\"\"Destroys all namespaces in the router_namespaces list.\"\"\""}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FprE%3D","line":249,"in_reply_to":"AAAASn%2F%2FqZg%3D","updated":"2013-09-01 13:47:32.000000000","message":"Done","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":254,"context_line":"            try:"},{"line_number":255,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":256,"context_line":"            except Exception:"},{"line_number":257,"context_line":"                LOG.exception(_(\"Failed deleting namespace \u0027%s\u0027\"), ns)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":260,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq9M%3D","line":257,"updated":"2013-08-31 09:50:51.000000000","message":"I\u0027d add exception message here in addition to namespace","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":254,"context_line":"            try:"},{"line_number":255,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":256,"context_line":"            except Exception:"},{"line_number":257,"context_line":"                LOG.exception(_(\"Failed deleting namespace \u0027%s\u0027\"), ns)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":260,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2FqZc%3D","line":257,"in_reply_to":"AAAASn%2F%2Fq0Y%3D","updated":"2013-08-31 21:12:48.000000000","message":"LOG.exception() is correct here.","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":254,"context_line":"            try:"},{"line_number":255,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":256,"context_line":"            except Exception:"},{"line_number":257,"context_line":"                LOG.exception(_(\"Failed deleting namespace \u0027%s\u0027\"), ns)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":260,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":18,"id":"AAAASn%2F%2Fq0Y%3D","line":257,"in_reply_to":"AAAASn%2F%2Fq9M%3D","updated":"2013-08-31 14:05:28.000000000","message":"This is a LOG.exception.  So the exception traceback is printed in the logfile.","commit_id":"274b1b9afc96b416dad4779f5e121ddfc83fec42"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"unresolved":false,"context_lines":[{"line_number":233,"context_line":"        If the routine hits an error while retrieving routers, it returns"},{"line_number":234,"context_line":"        without doing any namespace cleanup."},{"line_number":235,"context_line":"        \"\"\""},{"line_number":236,"context_line":"        if self.conf.router_id is None:"},{"line_number":237,"context_line":"            ns_to_destroy \u003d set()"},{"line_number":238,"context_line":"            try:"},{"line_number":239,"context_line":"                root_ip \u003d ip_lib.IPWrapper(self.root_helper)"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAASn%2F%2FGog%3D","line":236,"updated":"2013-09-11 23:03:21.000000000","message":"if self.conf.router_id:\n    return","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                        if ns.startswith(NS_PREFIX))"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":246,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":247,"context_line":"                ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":248,"context_line":"                ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":249,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAASn%2F%2B%2Byg%3D","line":246,"updated":"2013-09-14 16:29:21.000000000","message":"what the only_router_id mean? i checked the L3PluginApi.get_routers(), and found that it doesn\u0027t need this parameter","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":243,"context_line":"                                        if ns.startswith(NS_PREFIX))"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":246,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":247,"context_line":"                ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":248,"context_line":"                ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":249,"context_line":"            except Exception:"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAS3%2F%2FWqw%3D","line":246,"in_reply_to":"AAAASn%2F%2B%2Byg%3D","updated":"2013-09-28 18:10:36.000000000","message":"Only_router_id is useless, will delete.","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"unresolved":false,"context_lines":[{"line_number":245,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":246,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":247,"context_line":"                ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":248,"context_line":"                ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":249,"context_line":"            except Exception:"},{"line_number":250,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":251,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAASn%2F%2B%2ByU%3D","line":248,"updated":"2013-09-14 16:29:21.000000000","message":"the original behavior is that, l3 agent will destroy every router namespace which managed by it, and will create again when setup l3 agent. here, this patch will ignore the router namespace, what would happen when the l3 agent try to create this namespace and write ip_forward attr?","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":245,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":246,"context_line":"                                                      only_router_id\u003dNone)"},{"line_number":247,"context_line":"                ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":248,"context_line":"                ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":249,"context_line":"            except Exception:"},{"line_number":250,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":251,"context_line":"                                \"for namespace clean-up.\"))"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAS3%2F%2FWro%3D","line":248,"in_reply_to":"AAAASn%2F%2B%2ByU%3D","updated":"2013-09-28 17:55:26.000000000","message":"This patch avoids recreates the router_namespace the router is still found in the database and when the router namespace still exists on the host.  \n\nRouter namespace is not recreated if it already exists (_ensure_namespace).  The command to redo sysctl -w net.ipv4.ip_forward\u003d1.  Command is executed again with no error.","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _cleanup_namespaces(self):"},{"line_number":241,"context_line":"        \"\"\"Destroy all stale router namespaces on the host when"},{"line_number":242,"context_line":"        the L3 agent restarts."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        If the router_id parameter is set in l3_agent.ini, no router"},{"line_number":245,"context_line":"        namespaces are destroyed.  This is to allow for multiple L3"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAATn%2F%2FUnQ%3D","line":242,"updated":"2013-11-10 23:57:21.000000000","message":"Nit: It is better the summary line fits into one line. It is a docstring convention.","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"    def _cleanup_namespaces(self):"},{"line_number":241,"context_line":"        \"\"\"Destroy all stale router namespaces on the host when"},{"line_number":242,"context_line":"        the L3 agent restarts."},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"        If the router_id parameter is set in l3_agent.ini, no router"},{"line_number":245,"context_line":"        namespaces are destroyed.  This is to allow for multiple L3"}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAATn%2F%2FOiM%3D","line":242,"in_reply_to":"AAAATn%2F%2FUnQ%3D","updated":"2013-11-12 16:01:11.000000000","message":"Done","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"unresolved":false,"context_lines":[{"line_number":252,"context_line":"        if self.conf.router_id:"},{"line_number":253,"context_line":"            return"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        ns_to_destroy \u003d set()"},{"line_number":256,"context_line":"        try:"},{"line_number":257,"context_line":"            root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAATn%2F%2FUnY%3D","line":255,"updated":"2013-11-10 23:57:21.000000000","message":"Is it needed?\n\nns_to_destroy is set at L.265 and it is referred to in else clause, so I don\u0027t think there is a case where ns_to_destory is undefined when we go to L.270.","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":252,"context_line":"        if self.conf.router_id:"},{"line_number":253,"context_line":"            return"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        ns_to_destroy \u003d set()"},{"line_number":256,"context_line":"        try:"},{"line_number":257,"context_line":"            root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":258,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"AAAATn%2F%2FOh8%3D","line":255,"in_reply_to":"AAAATn%2F%2FUnY%3D","updated":"2013-11-12 16:01:11.000000000","message":"fixed.","commit_id":"fd058504dfd5d70b8b5d209b3c7f2f3ebb1213eb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":214,"context_line":"        self.removed_routers \u003d set()"},{"line_number":215,"context_line":"        self.sync_progress \u003d False"},{"line_number":216,"context_line":"        if self.conf.use_namespaces:"},{"line_number":217,"context_line":"            self._cleanup_namespaces()"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":220,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAATn%2F%2B5ow%3D","line":217,"updated":"2013-11-18 20:06:16.000000000","message":"as we now have a rpc_loop periodic task, I think there\u0027s probably no need anymore to do this check in __init__\n\ndoing it in __init__ will make the check pointless if the server is not running.\nMoving it in rpc_loop will allow us to retry the cleanup until the server responds (and then not do it anymore).","commit_id":"2d254b952cb042ec97fe6a635c45799f18392dbb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":214,"context_line":"        self.removed_routers \u003d set()"},{"line_number":215,"context_line":"        self.sync_progress \u003d False"},{"line_number":216,"context_line":"        if self.conf.use_namespaces:"},{"line_number":217,"context_line":"            self._cleanup_namespaces()"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":220,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":24,"id":"AAAATn%2F%2BmH0%3D","line":217,"in_reply_to":"AAAATn%2F%2B5ow%3D","updated":"2013-11-26 16:19:35.000000000","message":"Hi, Salvatore, yes that is a good idea. I will make the call to _cleanup_namespaces() from _rpc_loop.  It will retry until all the stale router namespaces have been cleaned up successfully.","commit_id":"2d254b952cb042ec97fe6a635c45799f18392dbb"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if self.conf.router_id or not self.conf.use_namespaces:"},{"line_number":218,"context_line":"            self._delete_stale_namespaces \u003d False"},{"line_number":219,"context_line":"        else:"},{"line_number":220,"context_line":"            self._delete_stale_namespaces \u003d True"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":223,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP8I%3D","line":220,"updated":"2013-11-28 10:52:40.000000000","message":"consider simplifying:\n\nself._delete_stale_namespaces \u003d self.conf.use_namespaces or not self.conf.router_id","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        if self.conf.router_id or not self.conf.use_namespaces:"},{"line_number":218,"context_line":"            self._delete_stale_namespaces \u003d False"},{"line_number":219,"context_line":"        else:"},{"line_number":220,"context_line":"            self._delete_stale_namespaces \u003d True"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":223,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BN1E%3D","line":220,"in_reply_to":"AAAATn%2F%2BP8I%3D","updated":"2013-11-30 02:51:34.000000000","message":"With the introduction of the router_delete_namespaces configurable, the else statement is now\n    self._delete_stale_namespaces \u003d self.conf.router_delete_namespaces.","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":258,"context_line":"            router_namespaces \u003d set(ns for ns in host_namespaces"},{"line_number":259,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"            routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":262,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":263,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":264,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP7w%3D","line":261,"updated":"2013-11-28 10:52:40.000000000","message":"I find wasteful and inefficient that the plugin rpc call which might have already performed in the caller is repeated here","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":258,"context_line":"            router_namespaces \u003d set(ns for ns in host_namespaces"},{"line_number":259,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":"            routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":262,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":263,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":264,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BN08%3D","line":261,"in_reply_to":"AAAATn%2F%2BP7w%3D","updated":"2013-11-30 02:51:34.000000000","message":"Added a router_list argument that defaults to None so that the router list passed in from _rpc_loop can be used here.","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":261,"context_line":"            routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":262,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":263,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":264,"context_line":"        except Exception:"},{"line_number":265,"context_line":"            LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":266,"context_line":"                            \"for namespace clean-up.\"))"},{"line_number":267,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP5Q%3D","line":264,"updated":"2013-11-28 10:52:40.000000000","message":"please avoid the broad exception and try to identify only the right type of exception you want to catch.","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":261,"context_line":"            routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":262,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":263,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":264,"context_line":"        except Exception:"},{"line_number":265,"context_line":"            LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":266,"context_line":"                            \"for namespace clean-up.\"))"},{"line_number":267,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BN0w%3D","line":264,"in_reply_to":"AAAATn%2F%2BP5Q%3D","updated":"2013-11-30 02:51:34.000000000","message":"Identified RemoteError and Runtime errors as possible exceptions that can happen here.","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":269,"context_line":""},{"line_number":270,"context_line":"    def _destroy_router_namespaces(self, router_namespaces):"},{"line_number":271,"context_line":"        \"\"\"Destroys all namespaces in the router_namespaces list.\"\"\""},{"line_number":272,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":273,"context_line":"        for ns in router_namespaces:"},{"line_number":274,"context_line":"            try:"},{"line_number":275,"context_line":"                self._destroy_router_namespace(ns)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP3U%3D","line":272,"updated":"2013-11-28 10:52:40.000000000","message":"I think it might more convenient to set it to False in the end","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":275,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":276,"context_line":"            except Exception:"},{"line_number":277,"context_line":"                LOG.exception(_(\"Failed deleting namespace \u0027%s\u0027\"), ns)"},{"line_number":278,"context_line":"                self._delete_stale_namespaces \u003d True"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":281,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP2s%3D","line":278,"updated":"2013-11-28 10:52:40.000000000","message":"Not super thrilled about the possibility of ending up in a situation where this routine (which does a call to the server) is called at every iteration if we fail to cleanup a namespace.\n\nIn some cases when a namespace is left in a \u0027dirty\u0027 state, it might be very stubborn to remove.\n\nPerhaps in order to avoid subsequent calls you can store these stubborn namespaces in a local list?","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":275,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":276,"context_line":"            except Exception:"},{"line_number":277,"context_line":"                LOG.exception(_(\"Failed deleting namespace \u0027%s\u0027\"), ns)"},{"line_number":278,"context_line":"                self._delete_stale_namespaces \u003d True"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":281,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BN04%3D","line":278,"in_reply_to":"AAAATn%2F%2BP2s%3D","updated":"2013-11-30 02:51:34.000000000","message":"Changed the behavior  not to retry deleting stale router namespaces.  So now only a RPC failure will cause retry of stale router namespace cleanup.","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":723,"context_line":"        # Upon error, resync is not necessary for the cleanup of stale"},{"line_number":724,"context_line":"        #  namespaces."},{"line_number":725,"context_line":"        if self._delete_stale_namespaces:"},{"line_number":726,"context_line":"            self._cleanup_namespaces()"},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"    def _process_router_delete(self):"},{"line_number":729,"context_line":"        current_removed_routers \u003d list(self.removed_routers)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BP6I%3D","line":726,"updated":"2013-11-28 10:52:40.000000000","message":"consider passing in routers if not none","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":723,"context_line":"        # Upon error, resync is not necessary for the cleanup of stale"},{"line_number":724,"context_line":"        #  namespaces."},{"line_number":725,"context_line":"        if self._delete_stale_namespaces:"},{"line_number":726,"context_line":"            self._cleanup_namespaces()"},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"    def _process_router_delete(self):"},{"line_number":729,"context_line":"        current_removed_routers \u003d list(self.removed_routers)"}],"source_content_type":"text/x-python","patch_set":25,"id":"AAAATn%2F%2BN00%3D","line":726,"in_reply_to":"AAAATn%2F%2BP6I%3D","updated":"2013-11-30 02:51:34.000000000","message":"Done","commit_id":"83e782f1195ca08f42d3bfe8e3cbc18c8763bd05"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":277,"context_line":"        \"\"\"Destroys all namespaces in the router_namespaces list.\"\"\""},{"line_number":278,"context_line":"        for ns in router_namespaces:"},{"line_number":279,"context_line":"            self._destroy_router_namespace(ns)"},{"line_number":280,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":283,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAATn%2F9pH0%3D","line":280,"updated":"2013-12-09 11:47:44.000000000","message":"This the last thing which is still not clear to me.\nAssume at __init__ self._delete_stale_namespace is True\n\nthe one fails to destroy a router namespace.\nthis happens quite often in cases where there are some leftover file descriptors and if self.conf.router_delete_namespaces\u003d\u003dTrue then the operation will fail with EBUSY.\n\nIn this case self._delete_namespace will stay true and I don\u0027t see how we will be able to avoid, for each iteration of rpc_loop i) fetching the whole router list, and ii) executing namespace_cleanup\nThis would be bad because it will require the l3 agent to perform unnecessary operations (fetching the whole list) and useless operations (trying to remove a namespace which likely won\u0027t go away)\n\nPerhaps there is something I am not reading appropriately here.\nTo be more clear, my concern is that the feature we are adding here, implemented this way, will actually end up making the agent less stable in presence of failures.","commit_id":"ad44764b5abf1021b96b34d1f332fc51cb997832"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":277,"context_line":"        \"\"\"Destroys all namespaces in the router_namespaces list.\"\"\""},{"line_number":278,"context_line":"        for ns in router_namespaces:"},{"line_number":279,"context_line":"            self._destroy_router_namespace(ns)"},{"line_number":280,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":283,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":26,"id":"AAAATn%2F9mys%3D","line":280,"in_reply_to":"AAAATn%2F9pH0%3D","updated":"2013-12-09 18:45:30.000000000","message":"I intended the deletion of stale namespace to be attempted only once.\n\nA RuntimeError exception is raised if the command to delete a namespace fails.  The exception is caught by self._destroy_router_namespace method.  The method also calls self.driver.unplug, which will catch the RuntimeError exceptions.\n\nSo in the method the entire list of stale router namespaces will be processed.  At the end self._delete_stale_namespaces is set to False and the deletion of stale router namespaces will be done only once. \n\nI will fix the deletion of stale namespaces be done only once in case _destroy_router_namespace raise other exceptions.","commit_id":"ad44764b5abf1021b96b34d1f332fc51cb997832"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":242,"context_line":"            LOG.error(msg)"},{"line_number":243,"context_line":"            raise SystemExit(msg)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _cleanup_namespaces(self, routers\u003dNone):"},{"line_number":246,"context_line":"        \"\"\"Destroy stale router namespaces on host when L3 agent restarts"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        If the router_id parameter is set in l3_agent.ini, no router"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8yGA%3D","line":245,"updated":"2013-12-20 11:22:36.000000000","message":"There is no caller that calls this without routers argument.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":242,"context_line":"            LOG.error(msg)"},{"line_number":243,"context_line":"            raise SystemExit(msg)"},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"    def _cleanup_namespaces(self, routers\u003dNone):"},{"line_number":246,"context_line":"        \"\"\"Destroy stale router namespaces on host when L3 agent restarts"},{"line_number":247,"context_line":""},{"line_number":248,"context_line":"        If the router_id parameter is set in l3_agent.ini, no router"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8l5Y%3D","line":245,"in_reply_to":"AAAATn%2F8yGA%3D","updated":"2013-12-24 22:56:29.000000000","message":"I will remove the default value in the next patch.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":260,"context_line":"            router_namespaces \u003d set(ns for ns in host_namespaces"},{"line_number":261,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8yFo%3D","line":263,"updated":"2013-12-20 11:22:36.000000000","message":"When routers is None?\nLooking at _rpc_loop(), it means plugin_rpc.get_routers() failed.\nIt doesn\u0027t seem safe to call it again here.\nShould cleanup be postponed to the next fullsync?","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":260,"context_line":"            router_namespaces \u003d set(ns for ns in host_namespaces"},{"line_number":261,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8l5Q%3D","line":263,"in_reply_to":"AAAATn%2F8yFo%3D","updated":"2013-12-24 22:56:29.000000000","message":"When there are _rpc_loop caught RPC exceptions, then _cleanup_namespaces may call plugin_rpc.get_routers again.   This will be fixed in the next patch.\n\nThe routine _cleanup_namespaces calls plugin_rpc.get_routers only if  the plugin_rpc.get_routers is not called from _rpc_loop.\n\nIf there were no errors in the plugin_rpc.get_routers call in _rpc_loop, then it will not be called again in _cleanup_namespaces. \n\nAlso _cleanup_namespace is only called when _delete_stale_namespaces is TRUE.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":267,"context_line":"        except rpc_common.RemoteError:"},{"line_number":268,"context_line":"            LOG.exception(_(\u0027RPC Error in obtaining router list \u0027"},{"line_number":269,"context_line":"                            \u0027for namespace cleanup.\u0027))"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8yHI%3D","line":266,"updated":"2013-12-20 11:22:36.000000000","message":"This destroys unrelated namespace. They should be filtered.\nPlease have a look at netns_cleanup_util.eligible_for_deletion().\nProbably the function should be moved to common place.\n\nip_lib.garbage_collect_namespace() may help or not.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":267,"context_line":"        except rpc_common.RemoteError:"},{"line_number":268,"context_line":"            LOG.exception(_(\u0027RPC Error in obtaining router list \u0027"},{"line_number":269,"context_line":"                            \u0027for namespace cleanup.\u0027))"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAT3%2F%2F%2BJI%3D","line":266,"in_reply_to":"AAAATn%2F8l3E%3D","updated":"2013-12-26 02:27:54.000000000","message":"I see, I missed line 262. Sorry.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":267,"context_line":"        except rpc_common.RemoteError:"},{"line_number":268,"context_line":"            LOG.exception(_(\u0027RPC Error in obtaining router list \u0027"},{"line_number":269,"context_line":"                            \u0027for namespace cleanup.\u0027))"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAT3%2F%2F%2Ftk%3D","line":266,"in_reply_to":"AAAATn%2F8l3E%3D","updated":"2013-12-25 07:19:33.000000000","message":"delete \"node crashing\" as one of the reason.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":263,"context_line":"            if routers is None:"},{"line_number":264,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":265,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":266,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":267,"context_line":"        except rpc_common.RemoteError:"},{"line_number":268,"context_line":"            LOG.exception(_(\u0027RPC Error in obtaining router list \u0027"},{"line_number":269,"context_line":"                            \u0027for namespace cleanup.\u0027))"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAATn%2F8l3E%3D","line":266,"in_reply_to":"AAAATn%2F8yHI%3D","updated":"2013-12-24 22:56:29.000000000","message":"The function is intended to be called when the self._delete_stale_namespaces evaluates to True.  See lines 218-222.\n\nThe stale namespaces being removed are those that begins with \u0027qrouter-\u0027 and are no longer as recorded in the database as being hosted on this node.\n\nThe _get_eligible_for_deletion function looks for those namespaces that has names that doesn\u0027t begin with \u0027qrouter-\u0027.  Also, only those namespace that only have the loopback device is eligible.  In the situation here, there could be router namespaces that were rescheduled to run on another node due to the L3-agent stopped running on this node for whatever reason (node crashing, L3-agent crashing, etc).  So when the L3-agent starts up again on this node, the router namespace, with all its devices, may no longer be valid.  As a result, they should be removed at the earliest opportunity.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":281,"context_line":"        # only make one attempt to delete them."},{"line_number":282,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":283,"context_line":"        for ns in router_namespaces:"},{"line_number":284,"context_line":"            self._destroy_router_namespace(ns)"},{"line_number":285,"context_line":""},{"line_number":286,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":287,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":27,"id":"AAAAT3%2F%2F%2FzY%3D","line":284,"updated":"2013-12-25 07:19:33.000000000","message":"ns_ip.get_devices can throw RuntimeError exceptions, which is not being caught by _destroy_router_namespaces.  So catch the exception here.","commit_id":"38b0e967c7b7041db5f22ef46434bbb5a94e59bd"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":267,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"            if routers is None:"},{"line_number":270,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":271,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":272,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":273,"context_line":"        except rpc_common.RemoteError:"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAT3%2F%2F6eU%3D","line":270,"updated":"2013-12-27 09:09:26.000000000","message":"When rpc failed, next loop should do fullsync.\n\nCan this rpc call be done in rpc_loop() before calling _cleanup_namespaes()?\nsomething like below.","commit_id":"b049f938ff23c8b012205394bee2b818010aa79e"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":267,"context_line":"                                    if ns.startswith(NS_PREFIX))"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"            if routers is None:"},{"line_number":270,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context)"},{"line_number":271,"context_line":"            ns_to_ignore \u003d set(NS_PREFIX + r[\u0027id\u0027] for r in routers)"},{"line_number":272,"context_line":"            ns_to_destroy \u003d router_namespaces - ns_to_ignore"},{"line_number":273,"context_line":"        except rpc_common.RemoteError:"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAT3%2F%2F4rk%3D","line":270,"in_reply_to":"AAAAT3%2F%2F6eU%3D","updated":"2013-12-28 01:51:27.000000000","message":"Will do in the next patch.","commit_id":"b049f938ff23c8b012205394bee2b818010aa79e"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":752,"context_line":"                               if router[\u0027id\u0027] in router_ids]"},{"line_number":753,"context_line":"                self._process_routers(routers)"},{"line_number":754,"context_line":"            self._process_router_delete()"},{"line_number":755,"context_line":"            LOG.debug(_(\"RPC loop successfully completed\"))"},{"line_number":756,"context_line":"        except Exception as e:"},{"line_number":757,"context_line":"            LOG.exception(_(\"Failed synchronizing routers\"))"},{"line_number":758,"context_line":"            self.fullsync \u003d True"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAT3%2F%2F6do%3D","line":755,"updated":"2013-12-27 09:09:26.000000000","message":"if self._delete_statle_namespace and router_list is None:\n    router_list \u003d  self.plugin_rpc.get_routers(self.context)\n\nThus routers argument to _cleanup_namespace() is always not-None.","commit_id":"b049f938ff23c8b012205394bee2b818010aa79e"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":752,"context_line":"                               if router[\u0027id\u0027] in router_ids]"},{"line_number":753,"context_line":"                self._process_routers(routers)"},{"line_number":754,"context_line":"            self._process_router_delete()"},{"line_number":755,"context_line":"            LOG.debug(_(\"RPC loop successfully completed\"))"},{"line_number":756,"context_line":"        except Exception as e:"},{"line_number":757,"context_line":"            LOG.exception(_(\"Failed synchronizing routers\"))"},{"line_number":758,"context_line":"            self.fullsync \u003d True"}],"source_content_type":"text/x-python","patch_set":28,"id":"AAAAT3%2F%2F4ro%3D","line":755,"in_reply_to":"AAAAT3%2F%2F6do%3D","updated":"2013-12-28 01:51:27.000000000","message":"OK, I will do the rpc call from outside _cleanup_namespaces in the next patch.","commit_id":"b049f938ff23c8b012205394bee2b818010aa79e"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":254,"context_line":"                if only_router_id and not only_router_id \u003d\u003d router_id:"},{"line_number":255,"context_line":"                    continue"},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"                if self.conf.enable_metadata_proxy:"},{"line_number":258,"context_line":"                    self._destroy_metadata_proxy(router_id, ns)"},{"line_number":259,"context_line":""},{"line_number":260,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F6F4%3D","side":"PARENT","line":257,"updated":"2014-01-06 23:51:27.000000000","message":"I missed that in a previous patch in this was removed (probably due to rebasing).  I had seen problems with deleting namespaces when the metadata proxy is left running which is why I added these lines.","commit_id":"84aeb9a407cde367ff4d6e2b5986dd0a689bc332"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":219,"context_line":"        if self.conf.router_id or not self.conf.use_namespaces:"},{"line_number":220,"context_line":"            self._delete_stale_namespaces \u003d False"},{"line_number":221,"context_line":"        else:"},{"line_number":222,"context_line":"            self._delete_stale_namespaces \u003d self.conf.router_delete_namespaces"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":225,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F6GY%3D","line":222,"updated":"2014-01-06 23:51:27.000000000","message":"It might be more palatable for this assignment to be done with one single boolean statement:\n\n\u003d self.conf.router_delete_namespaces and self.conf.use_namespaces and not self.conf.router_id","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":219,"context_line":"        if self.conf.router_id or not self.conf.use_namespaces:"},{"line_number":220,"context_line":"            self._delete_stale_namespaces \u003d False"},{"line_number":221,"context_line":"        else:"},{"line_number":222,"context_line":"            self._delete_stale_namespaces \u003d self.conf.router_delete_namespaces"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("},{"line_number":225,"context_line":"            self._rpc_loop)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F0YU%3D","line":222,"in_reply_to":"AAAAUH%2F%2F6GY%3D","updated":"2014-01-08 04:41:27.000000000","message":"WIll be done in the next patch.","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":282,"context_line":"        # As some stale namespaces may not be able to be deleted,"},{"line_number":283,"context_line":"        # only make one attempt to delete them."},{"line_number":284,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":285,"context_line":"        for ns in router_namespaces:"},{"line_number":286,"context_line":"            try:"},{"line_number":287,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":288,"context_line":"            except RuntimeError:"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F0YE%3D","line":285,"updated":"2014-01-08 04:41:27.000000000","message":"Will add \nif self.conf.enable_metadata_proxy:\n    self._destroy_metadata_proxy(ns[len(NS_PREFIX):], ns)","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":287,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":288,"context_line":"            except RuntimeError:"},{"line_number":289,"context_line":"                msg \u003d _(\u0027Failed to destroy stale router namespace %s\u0027)"},{"line_number":290,"context_line":"                LOG.exception(msg % ns)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":293,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F6Cg%3D","line":290,"updated":"2014-01-06 23:51:27.000000000","message":"Tiny nit:  I think passing these like (msg, ns) instead of (msg % ns) allows for lazy evaluation of the final string.  I just learned that from one of my patch reviews.","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":287,"context_line":"                self._destroy_router_namespace(ns)"},{"line_number":288,"context_line":"            except RuntimeError:"},{"line_number":289,"context_line":"                msg \u003d _(\u0027Failed to destroy stale router namespace %s\u0027)"},{"line_number":290,"context_line":"                LOG.exception(msg % ns)"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":293,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F0YQ%3D","line":290,"in_reply_to":"AAAAUH%2F%2F6Cg%3D","updated":"2014-01-08 04:41:27.000000000","message":"Will fix in the next patch.","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":753,"context_line":"        except Exception as e:"},{"line_number":754,"context_line":"            LOG.exception(_(\"Failed synchronizing routers\"))"},{"line_number":755,"context_line":"            self.fullsync \u003d True"},{"line_number":756,"context_line":"            if isinstance(e, rpc_common.RemoteError):"},{"line_number":757,"context_line":"                return"},{"line_number":758,"context_line":""},{"line_number":759,"context_line":"        # Resync is not necessary for the cleanup of stale"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F6Do%3D","line":756,"updated":"2014-01-06 23:51:27.000000000","message":"Could catch this in its own except clause:\n\nexcept rpc_common.RemoteError:\n    self.fullsync \u003d True\n    return\nexcept Exception:\n    ...","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":753,"context_line":"        except Exception as e:"},{"line_number":754,"context_line":"            LOG.exception(_(\"Failed synchronizing routers\"))"},{"line_number":755,"context_line":"            self.fullsync \u003d True"},{"line_number":756,"context_line":"            if isinstance(e, rpc_common.RemoteError):"},{"line_number":757,"context_line":"                return"},{"line_number":758,"context_line":""},{"line_number":759,"context_line":"        # Resync is not necessary for the cleanup of stale"}],"source_content_type":"text/x-python","patch_set":29,"id":"AAAAUH%2F%2F0X4%3D","line":756,"in_reply_to":"AAAAUH%2F%2F6Do%3D","updated":"2014-01-08 04:41:27.000000000","message":"OK, will be changed in the next patch.","commit_id":"9c1d601bbbfb1561fdb176c6d26a0364399220bb"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"unresolved":false,"context_lines":[{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _destroy_stale_router_namespaces(self, router_namespaces):"},{"line_number":278,"context_line":"        \"\"\"Destroys the namespaces in the router_namespaces list."},{"line_number":279,"context_line":"           The namespaces in the list are all stale."},{"line_number":280,"context_line":"        \"\"\""},{"line_number":281,"context_line":"        # As some stale namespaces may not be able to be deleted,"},{"line_number":282,"context_line":"        # only make one attempt to delete them."}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FuXU%3D","line":279,"updated":"2014-01-09 06:31:21.000000000","message":"nit: pep257 rules not met","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":276,"context_line":""},{"line_number":277,"context_line":"    def _destroy_stale_router_namespaces(self, router_namespaces):"},{"line_number":278,"context_line":"        \"\"\"Destroys the namespaces in the router_namespaces list."},{"line_number":279,"context_line":"           The namespaces in the list are all stale."},{"line_number":280,"context_line":"        \"\"\""},{"line_number":281,"context_line":"        # As some stale namespaces may not be able to be deleted,"},{"line_number":282,"context_line":"        # only make one attempt to delete them."}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2Fqoc%3D","line":279,"in_reply_to":"AAAAUH%2F%2FuXU%3D","updated":"2014-01-10 00:14:18.000000000","message":"WIll be fixed in the next patch.","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":746,"context_line":"                router_ids \u003d list(self.updated_routers)"},{"line_number":747,"context_line":"                self.updated_routers.clear()"},{"line_number":748,"context_line":"                if router_list is None:"},{"line_number":749,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":750,"context_line":"                                                          router_ids)"},{"line_number":751,"context_line":"                else:"},{"line_number":752,"context_line":"                    routers \u003d [router for router in router_list"}],"source_content_type":"text/x-python","patch_set":31,"id":"AAAAUH%2F%2FpVc%3D","line":749,"updated":"2014-01-10 05:47:19.000000000","message":"try to do it in _sync_routers_task. the rcp_loop is for works after l3 agent starts.","commit_id":"a6833ca69c762965ae1fd23829bd31200bf5684e"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":746,"context_line":"                router_ids \u003d list(self.updated_routers)"},{"line_number":747,"context_line":"                self.updated_routers.clear()"},{"line_number":748,"context_line":"                if router_list is None:"},{"line_number":749,"context_line":"                    routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":750,"context_line":"                                                          router_ids)"},{"line_number":751,"context_line":"                else:"},{"line_number":752,"context_line":"                    routers \u003d [router for router in router_list"}],"source_content_type":"text/x-python","patch_set":31,"id":"AAAAUH%2F%2FjX4%3D","line":749,"in_reply_to":"AAAAUH%2F%2FpVc%3D","updated":"2014-01-11 14:39:28.000000000","message":"will move the changes to _sync_routers_task.","commit_id":"a6833ca69c762965ae1fd23829bd31200bf5684e"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self.sync_progress \u003d False"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        self._delete_stale_namespaces \u003d (self.conf.use_namespaces and"},{"line_number":220,"context_line":"                                         not self.conf.router_id and"},{"line_number":221,"context_line":"                                         self.conf.router_delete_namespaces)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("}],"source_content_type":"text/x-python","patch_set":32,"id":"AAAAUH%2F%2FaQk%3D","line":220,"updated":"2014-01-14 01:47:30.000000000","message":"why should we use \u0027not self.conf.router_id\u0027?\nthe system may be like this:\nrouter_id\u003da\n\nand after running a while, change router_id into b,\nwe start again, the namespace for \u0027a\u0027 should be deleted.","commit_id":"e1e1523351376887a479939221b6bec9f519f7ca"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self.sync_progress \u003d False"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"        self._delete_stale_namespaces \u003d (self.conf.use_namespaces and"},{"line_number":220,"context_line":"                                         not self.conf.router_id and"},{"line_number":221,"context_line":"                                         self.conf.router_delete_namespaces)"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"        self.rpc_loop \u003d loopingcall.FixedIntervalLoopingCall("}],"source_content_type":"text/x-python","patch_set":32,"id":"AAAAUH%2F%2FPUk%3D","line":220,"in_reply_to":"AAAAUH%2F%2FaQk%3D","updated":"2014-01-16 01:30:15.000000000","message":"Done","commit_id":"e1e1523351376887a479939221b6bec9f519f7ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":771,"context_line":"            router_ids \u003d self._router_ids()"},{"line_number":772,"context_line":"            self.updated_routers.clear()"},{"line_number":773,"context_line":"            self.removed_routers.clear()"},{"line_number":774,"context_line":"            router_list \u003d self.plugin_rpc.get_routers(context)"},{"line_number":775,"context_line":"            if router_ids:"},{"line_number":776,"context_line":"                routers \u003d [router for router in router_list"},{"line_number":777,"context_line":"                           if router[\u0027id\u0027] in router_ids]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2FAsA%3D","line":774,"updated":"2014-01-19 07:57:17.000000000","message":"I think we should use get_routers(context, router_ids). so the line 795 should delete the namespaces except the ones for router_ids got from 771.\n\nThis reason is:\nif we have non-empty router_ids at 771,  it means this l3 agent can only host these routers. to keep other namespaces makes no sense.\n\nIn addition, if we call get_routers() without router_ids and we have router_ids at line 771, it will cause neutron server to schedule other non-scheduled routers on this agent. but in fact, this agent can only host the specified routers at line 771.","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"},{"author":{"_account_id":7769,"name":"Pentheus","display_name":"Alan Meadows","email":"alan.meadows@gmail.com","username":"alanmeadows"},"unresolved":false,"context_lines":[{"line_number":771,"context_line":"            router_ids \u003d self._router_ids()"},{"line_number":772,"context_line":"            self.updated_routers.clear()"},{"line_number":773,"context_line":"            self.removed_routers.clear()"},{"line_number":774,"context_line":"            router_list \u003d self.plugin_rpc.get_routers(context)"},{"line_number":775,"context_line":"            if router_ids:"},{"line_number":776,"context_line":"                routers \u003d [router for router in router_list"},{"line_number":777,"context_line":"                           if router[\u0027id\u0027] in router_ids]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B6kg%3D","line":774,"in_reply_to":"AAAAUH%2F%2B%2B7U%3D","updated":"2014-01-20 19:42:55.000000000","message":"I like the approach above since cleaning unassigned namespaces is critical.  That said, I don\u0027t think its possible to support that *and* 2 or more L3 agents with unique IDs on a single host without more information available -- otherwise the cleanup process will step on the other agents?","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":771,"context_line":"            router_ids \u003d self._router_ids()"},{"line_number":772,"context_line":"            self.updated_routers.clear()"},{"line_number":773,"context_line":"            self.removed_routers.clear()"},{"line_number":774,"context_line":"            router_list \u003d self.plugin_rpc.get_routers(context)"},{"line_number":775,"context_line":"            if router_ids:"},{"line_number":776,"context_line":"                routers \u003d [router for router in router_list"},{"line_number":777,"context_line":"                           if router[\u0027id\u0027] in router_ids]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2Bsgo%3D","line":774,"in_reply_to":"AAAAUH%2F%2B6kg%3D","updated":"2014-01-23 04:10:26.000000000","message":"Will fix in the next patch.","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"unresolved":false,"context_lines":[{"line_number":771,"context_line":"            router_ids \u003d self._router_ids()"},{"line_number":772,"context_line":"            self.updated_routers.clear()"},{"line_number":773,"context_line":"            self.removed_routers.clear()"},{"line_number":774,"context_line":"            router_list \u003d self.plugin_rpc.get_routers(context)"},{"line_number":775,"context_line":"            if router_ids:"},{"line_number":776,"context_line":"                routers \u003d [router for router in router_list"},{"line_number":777,"context_line":"                           if router[\u0027id\u0027] in router_ids]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2FAU0%3D","line":774,"in_reply_to":"AAAAUH%2F%2FAsA%3D","updated":"2014-01-19 12:53:51.000000000","message":"Agreed. Using get_routers(ctx, router_ids) would also mean you could eliminate lines 775-779 entirely.","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":771,"context_line":"            router_ids \u003d self._router_ids()"},{"line_number":772,"context_line":"            self.updated_routers.clear()"},{"line_number":773,"context_line":"            self.removed_routers.clear()"},{"line_number":774,"context_line":"            router_list \u003d self.plugin_rpc.get_routers(context)"},{"line_number":775,"context_line":"            if router_ids:"},{"line_number":776,"context_line":"                routers \u003d [router for router in router_list"},{"line_number":777,"context_line":"                           if router[\u0027id\u0027] in router_ids]"}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2B%2B7U%3D","line":774,"in_reply_to":"AAAAUH%2F%2FAsA%3D","updated":"2014-01-20 05:00:15.000000000","message":"Thanks for your comments.  I was under the impression that 2 or more L3 agents (each managing a router_id) can be run on a host.  Is this incorrect?","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"unresolved":false,"context_lines":[{"line_number":271,"context_line":"        As some stale router namespaces may not be able to be deleted, only"},{"line_number":272,"context_line":"        one attempt will be made to delete them."},{"line_number":273,"context_line":"        \"\"\""},{"line_number":274,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":275,"context_line":"        for ns in router_namespaces:"},{"line_number":276,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":277,"context_line":"                self._destroy_metadata_proxy(ns[len(NS_PREFIX):], ns)"}],"source_content_type":"text/x-python","patch_set":34,"id":"AAAAUH%2F%2BhZc%3D","line":274,"updated":"2014-01-24 19:41:11.000000000","message":"nitpick: moving this line before line 792 would make the logic clearer.","commit_id":"b6368b4e6703707a67ad5348e8faef475927ef1d"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":271,"context_line":"        As some stale router namespaces may not be able to be deleted, only"},{"line_number":272,"context_line":"        one attempt will be made to delete them."},{"line_number":273,"context_line":"        \"\"\""},{"line_number":274,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":275,"context_line":"        for ns in router_namespaces:"},{"line_number":276,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":277,"context_line":"                self._destroy_metadata_proxy(ns[len(NS_PREFIX):], ns)"}],"source_content_type":"text/x-python","patch_set":34,"id":"AAAAUH%2F%2BfD0%3D","line":274,"in_reply_to":"AAAAUH%2F%2BhZc%3D","updated":"2014-01-25 04:25:15.000000000","message":"I will change this in the next patch.","commit_id":"b6368b4e6703707a67ad5348e8faef475927ef1d"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":280,"context_line":"            except RuntimeError:"},{"line_number":281,"context_line":"                LOG.exception(_(\u0027Failed to destroy stale router namespace \u0027"},{"line_number":282,"context_line":"                                \u0027%s\u0027), ns)"},{"line_number":283,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":286,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAUH%2F%2BbXs%3D","line":283,"updated":"2014-01-26 23:25:10.000000000","message":"If there is any error happens at line 279, the line 283 should not be run.","commit_id":"011d99f300ea5d5f4ce48023bd04a795a4872287"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"unresolved":false,"context_lines":[{"line_number":280,"context_line":"            except RuntimeError:"},{"line_number":281,"context_line":"                LOG.exception(_(\u0027Failed to destroy stale router namespace \u0027"},{"line_number":282,"context_line":"                                \u0027%s\u0027), ns)"},{"line_number":283,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":286,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAUX%2F%2Fn8w%3D","line":283,"in_reply_to":"AAAAUH%2F%2BODQ%3D","updated":"2014-02-11 22:30:12.000000000","message":"I agree that if deleting a namespace fails then it is not likely it will succeed the next time around without assume intervention.  It would be unwise to continually rerun this loop in that event.  I agree with Stephen","commit_id":"011d99f300ea5d5f4ce48023bd04a795a4872287"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":280,"context_line":"            except RuntimeError:"},{"line_number":281,"context_line":"                LOG.exception(_(\u0027Failed to destroy stale router namespace \u0027"},{"line_number":282,"context_line":"                                \u0027%s\u0027), ns)"},{"line_number":283,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":286,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAUH%2F%2BODQ%3D","line":283,"in_reply_to":"AAAAUH%2F%2BbXs%3D","updated":"2014-01-29 00:15:18.000000000","message":"I only want to have namespace deletion be done once.  From my experience, if the deletion of the namespace failed once.  The next attempt will also fail.  So only one attempt is to be made.","commit_id":"011d99f300ea5d5f4ce48023bd04a795a4872287"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"4b5ef992654e65263174129a0445d44f8f4c7004","unresolved":false,"context_lines":[{"line_number":280,"context_line":"            except RuntimeError:"},{"line_number":281,"context_line":"                LOG.exception(_(\u0027Failed to destroy stale router namespace \u0027"},{"line_number":282,"context_line":"                                \u0027%s\u0027), ns)"},{"line_number":283,"context_line":"        self._delete_stale_namespaces \u003d False"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def _destroy_router_namespace(self, namespace):"},{"line_number":286,"context_line":"        ns_ip \u003d ip_lib.IPWrapper(self.root_helper, namespace\u003dnamespace)"}],"source_content_type":"text/x-python","patch_set":35,"id":"AAAAUX%2F%2BU9Q%3D","line":283,"in_reply_to":"AAAAUX%2F%2Fn8w%3D","updated":"2014-02-21 20:56:35.000000000","message":"the logic here is correct","commit_id":"011d99f300ea5d5f4ce48023bd04a795a4872287"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":6676,"name":"zqfan","email":"aji.zqfan@gmail.com","username":"aji-zqfan"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def testAgentCreate(self):"},{"line_number":112,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def testAgentCreateWithCleanup(self):"},{"line_number":115,"context_line":"        self.conf.set_override(\u0027router_id\u0027, None)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        router_list \u003d [{\u0027id\u0027: _uuid()}]"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAASn%2F%2B%2ByQ%3D","line":114,"updated":"2013-09-14 16:29:21.000000000","message":"i think _ format is more common than camel style in neutron project","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":6072,"name":"Eugene Nikanorov","email":"enikanorov@mirantis.com","username":"enikanorov"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"    def testAgentCreate(self):"},{"line_number":112,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":113,"context_line":""},{"line_number":114,"context_line":"    def testAgentCreateWithCleanup(self):"},{"line_number":115,"context_line":"        self.conf.set_override(\u0027router_id\u0027, None)"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"        router_list \u003d [{\u0027id\u0027: _uuid()}]"}],"source_content_type":"text/x-python","patch_set":20,"id":"AAAAS3%2F%2F%2F%2BQ%3D","line":114,"in_reply_to":"AAAASn%2F%2B%2ByQ%3D","updated":"2013-09-14 17:54:49.000000000","message":"the style is mixed in this file, so it\u0027s better to do style cleanup in separate file","commit_id":"0e78579da993961266db246d0183800782b5302b"},{"author":{"_account_id":7823,"name":"Xiang Hui","email":"xianghuir@gmail.com","username":"xianghui"},"unresolved":false,"context_lines":[{"line_number":585,"context_line":"        agent._process_router_delete()"},{"line_number":586,"context_line":"        self.assertFalse(list(agent.removed_routers))"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def test_cleanup_namespace(self):"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        class FakeDev(object):"},{"line_number":591,"context_line":"            def __init__(self, name):"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAS3%2F%2FV%2Bc%3D","line":588,"updated":"2013-09-29 10:36:38.000000000","message":"Personally I think you are going to test three points to be tested : 1. router_id is set in conf, 2. router_id isn\u0027t set , no ignored_router_ids 3. router_id isn\u0027t set, have ignored_router_ids.\n\nMaybe you can refactor there two functions by trying to extract the common part like defining the class FakeDev, self.conf.override..., and won\u0027t need to call _cleanup_namespaces(), since it will be called by the l3 init().","commit_id":"0252f4ed6cf6dc9637d516dc1348baa948392a31"},{"author":{"_account_id":7823,"name":"Xiang Hui","email":"xianghuir@gmail.com","username":"xianghui"},"unresolved":false,"context_lines":[{"line_number":585,"context_line":"        agent._process_router_delete()"},{"line_number":586,"context_line":"        self.assertFalse(list(agent.removed_routers))"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def test_cleanup_namespace(self):"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        class FakeDev(object):"},{"line_number":591,"context_line":"            def __init__(self, name):"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAATH%2F%2F1bs%3D","line":588,"in_reply_to":"AAAAS3%2F%2FDvc%3D","updated":"2013-10-09 07:33:36.000000000","message":"Ok, I\u0027m ok with that.","commit_id":"0252f4ed6cf6dc9637d516dc1348baa948392a31"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":585,"context_line":"        agent._process_router_delete()"},{"line_number":586,"context_line":"        self.assertFalse(list(agent.removed_routers))"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"    def test_cleanup_namespace(self):"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        class FakeDev(object):"},{"line_number":591,"context_line":"            def __init__(self, name):"}],"source_content_type":"text/x-python","patch_set":22,"id":"AAAAS3%2F%2FDvc%3D","line":588,"in_reply_to":"AAAAS3%2F%2FV%2Bc%3D","updated":"2013-10-05 14:08:46.000000000","message":"The ignore_router_id is an argument that doesn\u0027t exist in get_routers,  It has already been removed from the patch.  As for the case where self.conf.router_id is set, the case is trivial.  It has been tested here in line 603. The test depends on no action being done during the agent construction.  Otherwise, the test would have an exception at line 603.","commit_id":"0252f4ed6cf6dc9637d516dc1348baa948392a31"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":835,"context_line":""},{"line_number":836,"context_line":"        self.mock_ip.get_namespaces.return_value \u003d [qrouter_foo, qrouter_bar]"},{"line_number":837,"context_line":"        self.mock_ip.get_devices.return_value \u003d [FakeDev(\u0027qr-aaaa\u0027),"},{"line_number":838,"context_line":"                                                 FakeDev(\u0027qgw-aaaa\u0027)]"},{"line_number":839,"context_line":""},{"line_number":840,"context_line":"        agent \u003d l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":841,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FqoE%3D","line":838,"updated":"2014-01-10 00:14:18.000000000","message":"This mock is not needed will be removed.","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"unresolved":false,"context_lines":[{"line_number":844,"context_line":""},{"line_number":845,"context_line":"        self.assertTrue(agent._delete_stale_namespaces)"},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        #self.plugin_api.get_routers.return_value \u003d []"},{"line_number":848,"context_line":"        router_list \u003d []"},{"line_number":849,"context_line":"        agent._destroy_router_namespace \u003d mock.MagicMock()"},{"line_number":850,"context_line":"        agent._cleanup_namespaces(router_list)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FuYw%3D","line":847,"updated":"2014-01-09 06:31:21.000000000","message":"please remove","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":844,"context_line":""},{"line_number":845,"context_line":"        self.assertTrue(agent._delete_stale_namespaces)"},{"line_number":846,"context_line":""},{"line_number":847,"context_line":"        #self.plugin_api.get_routers.return_value \u003d []"},{"line_number":848,"context_line":"        router_list \u003d []"},{"line_number":849,"context_line":"        agent._destroy_router_namespace \u003d mock.MagicMock()"},{"line_number":850,"context_line":"        agent._cleanup_namespaces(router_list)"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FqoU%3D","line":847,"in_reply_to":"AAAAUH%2F%2FuYw%3D","updated":"2014-01-10 00:14:18.000000000","message":"Done","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"unresolved":false,"context_lines":[{"line_number":856,"context_line":"            any_order\u003dTrue)"},{"line_number":857,"context_line":"        self.assertFalse(agent._delete_stale_namespaces)"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"    def test_cleanup_namespace_with_registered_router_ids(self):"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"        class FakeDev(object):"},{"line_number":862,"context_line":"            def __init__(self, name):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FuXY%3D","line":859,"updated":"2014-01-09 06:31:21.000000000","message":"a lot of duplicated code in two added test cases. Consider refactor to one helper method and call it from these 2 tests.","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":856,"context_line":"            any_order\u003dTrue)"},{"line_number":857,"context_line":"        self.assertFalse(agent._delete_stale_namespaces)"},{"line_number":858,"context_line":""},{"line_number":859,"context_line":"    def test_cleanup_namespace_with_registered_router_ids(self):"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"        class FakeDev(object):"},{"line_number":862,"context_line":"            def __init__(self, name):"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2Fqng%3D","line":859,"in_reply_to":"AAAAUH%2F%2FuXY%3D","updated":"2014-01-10 00:14:18.000000000","message":"The only difference in the test is that different parameters are passed to the routine under test.  Will refactor as suggested in the next patch.","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"unresolved":false,"context_lines":[{"line_number":885,"context_line":""},{"line_number":886,"context_line":"        self.assertTrue(agent._delete_stale_namespaces)"},{"line_number":887,"context_line":""},{"line_number":888,"context_line":"        pm \u003d self.external_process.return_value"},{"line_number":889,"context_line":"        pm.reset_mock()"},{"line_number":890,"context_line":""},{"line_number":891,"context_line":"        agent._destroy_router_namespace \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FuYU%3D","line":888,"updated":"2014-01-09 06:31:21.000000000","message":"not needed as already set on #883","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"unresolved":false,"context_lines":[{"line_number":885,"context_line":""},{"line_number":886,"context_line":"        self.assertTrue(agent._delete_stale_namespaces)"},{"line_number":887,"context_line":""},{"line_number":888,"context_line":"        pm \u003d self.external_process.return_value"},{"line_number":889,"context_line":"        pm.reset_mock()"},{"line_number":890,"context_line":""},{"line_number":891,"context_line":"        agent._destroy_router_namespace \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":30,"id":"AAAAUH%2F%2FqOs%3D","line":888,"in_reply_to":"AAAAUH%2F%2FuYU%3D","updated":"2014-01-10 00:14:18.000000000","message":"This will be removed as part of the refactor.","commit_id":"7c97222467a5a745c184d6e105d9b8757ea427ba"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"unresolved":false,"context_lines":[{"line_number":954,"context_line":"        self._cleanup_namespace_test(stale_namespaces,"},{"line_number":955,"context_line":"                                     router_list,"},{"line_number":956,"context_line":"                                     other_namespaces)"},{"line_number":957,"context_line":""},{"line_number":958,"context_line":""},{"line_number":959,"context_line":"class TestL3AgentEventHandler(base.BaseTestCase):"},{"line_number":960,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"AAAAUH%2F%2FAUg%3D","line":957,"updated":"2014-01-19 12:53:51.000000000","message":"Nice work on above unit tests.","commit_id":"ff53670673a0577ff01a803d815269d841767dfb"}],"quantum/agent/l3_agent.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            except rpc_common.RemoteError as e:"},{"line_number":174,"context_line":"                router_ids \u003d None"},{"line_number":175,"context_line":"                if str(e.exc_type) \u003d\u003d \u0027AgentNotFoundByTypeHost\u0027:"},{"line_number":176,"context_line":"                    LOG.info(\"Agent has not been registered. \""},{"line_number":177,"context_line":"                             \"Unable to obtain router ids for namespace \""},{"line_number":178,"context_line":"                             \"clean-up at this time.\")"},{"line_number":179,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzU%3D","line":176,"updated":"2013-05-30 06:32:52.000000000","message":"please use the i18n format\n\nLOG.info(_(\"Agent ....\"))","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            except rpc_common.RemoteError as e:"},{"line_number":174,"context_line":"                router_ids \u003d None"},{"line_number":175,"context_line":"                if str(e.exc_type) \u003d\u003d \u0027AgentNotFoundByTypeHost\u0027:"},{"line_number":176,"context_line":"                    LOG.info(\"Agent has not been registered. \""},{"line_number":177,"context_line":"                             \"Unable to obtain router ids for namespace \""},{"line_number":178,"context_line":"                             \"clean-up at this time.\")"},{"line_number":179,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fj3M%3D","line":176,"in_reply_to":"AAAAPH%2F%2FkzU%3D","updated":"2013-05-31 03:46:05.000000000","message":"Done","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                             \"Unable to obtain router ids for namespace \""},{"line_number":178,"context_line":"                             \"clean-up at this time.\")"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.warning(\"Error in obtaining router-ids info \""},{"line_number":181,"context_line":"                                \"for namespace clean-up : \" + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                router_ids \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzQ%3D","line":180,"updated":"2013-05-30 06:32:52.000000000","message":"Ditto.\nWhy not LOG.exception?","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                             \"Unable to obtain router ids for namespace \""},{"line_number":178,"context_line":"                             \"clean-up at this time.\")"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.warning(\"Error in obtaining router-ids info \""},{"line_number":181,"context_line":"                                \"for namespace clean-up : \" + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                router_ids \u003d None"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fj3I%3D","line":180,"in_reply_to":"AAAAPH%2F%2FkzQ%3D","updated":"2013-05-31 03:46:05.000000000","message":"Done","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                \"for namespace clean-up : \" + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                router_ids \u003d None"},{"line_number":184,"context_line":"                LOG.error(\"Error in namespace clean-up : \" + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzM%3D","line":184,"updated":"2013-05-30 06:32:52.000000000","message":"Ditto for i18n and Log exception","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                \"for namespace clean-up : \" + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                router_ids \u003d None"},{"line_number":184,"context_line":"                LOG.error(\"Error in namespace clean-up : \" + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fj3E%3D","line":184,"in_reply_to":"AAAAPH%2F%2FkzM%3D","updated":"2013-05-31 03:46:05.000000000","message":"Done","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                router_ids \u003d None"},{"line_number":184,"context_line":"                LOG.error(\"Error in namespace clean-up : \" + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzI%3D","line":186,"updated":"2013-05-30 06:32:52.000000000","message":"if there is an exception is there any reason to call this function?","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                router_ids \u003d None"},{"line_number":184,"context_line":"                LOG.error(\"Error in namespace clean-up : \" + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Firc%3D","line":186,"in_reply_to":"AAAAPH%2F%2FkzI%3D","updated":"2013-05-31 03:46:05.000000000","message":"When get_routers errors out, we want to cleanup all namespaces.","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                if only_router_id and not ns.endswith(only_router_id):"},{"line_number":204,"context_line":"                    continue"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"                if (ignore_router_ids and"},{"line_number":207,"context_line":"                        ns.strip(NS_PREFIX) in ignore_router_ids):"},{"line_number":208,"context_line":"                    continue"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fky8%3D","line":206,"updated":"2013-05-30 06:32:52.000000000","message":"this is a bit confusing. please consider changing the name of the variables","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                if only_router_id and not ns.endswith(only_router_id):"},{"line_number":204,"context_line":"                    continue"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"                if (ignore_router_ids and"},{"line_number":207,"context_line":"                        ns.strip(NS_PREFIX) in ignore_router_ids):"},{"line_number":208,"context_line":"                    continue"},{"line_number":209,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FiqI%3D","line":206,"in_reply_to":"AAAAPH%2F%2Fky8%3D","updated":"2013-05-31 03:46:05.000000000","message":"renamed to ids_to_ignore.","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":608,"context_line":""},{"line_number":609,"context_line":"    def _process_routers(self, routers, all_routers\u003dFalse):"},{"line_number":610,"context_line":"        if (self.conf.external_network_bridge and"},{"line_number":611,"context_line":"                not ip_lib.device_exists(self.conf.external_network_bridge)):"},{"line_number":612,"context_line":"            LOG.error(_(\"The external network bridge \u0027%s\u0027 does not exist\"),"},{"line_number":613,"context_line":"                      self.conf.external_network_bridge)"},{"line_number":614,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzE%3D","line":611,"updated":"2013-05-30 06:32:52.000000000","message":"why do we need this change?","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":608,"context_line":""},{"line_number":609,"context_line":"    def _process_routers(self, routers, all_routers\u003dFalse):"},{"line_number":610,"context_line":"        if (self.conf.external_network_bridge and"},{"line_number":611,"context_line":"                not ip_lib.device_exists(self.conf.external_network_bridge)):"},{"line_number":612,"context_line":"            LOG.error(_(\"The external network bridge \u0027%s\u0027 does not exist\"),"},{"line_number":613,"context_line":"                      self.conf.external_network_bridge)"},{"line_number":614,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fj3w%3D","line":611,"in_reply_to":"AAAAPH%2F%2FkzE%3D","updated":"2013-05-31 03:46:05.000000000","message":"This was error with  \"pep8 l3_agent.py\" (E125  continuation line does not distinguish itself from next logical line), this is the only reason.  But \"tox -e pep8\" didn\u0027t raise the issue. So I will undo this change.","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"ba37515772da4472108e0a8e58d5887b6c3fec96","unresolved":false,"context_lines":[{"line_number":632,"context_line":"            # If namespaces are disabled, only process the router associated"},{"line_number":633,"context_line":"            # with the configured agent id."},{"line_number":634,"context_line":"            if (not self.conf.use_namespaces and"},{"line_number":635,"context_line":"                    r[\u0027id\u0027] !\u003d self.conf.router_id):"},{"line_number":636,"context_line":"                continue"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"            ex_net_id \u003d (r[\u0027external_gateway_info\u0027] or {}).get(\u0027network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2FkzA%3D","line":635,"updated":"2013-05-30 06:32:52.000000000","message":"ditto?","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"7c258512fc1fadd5bb7444ae23e38a242722a53b","unresolved":false,"context_lines":[{"line_number":632,"context_line":"            # If namespaces are disabled, only process the router associated"},{"line_number":633,"context_line":"            # with the configured agent id."},{"line_number":634,"context_line":"            if (not self.conf.use_namespaces and"},{"line_number":635,"context_line":"                    r[\u0027id\u0027] !\u003d self.conf.router_id):"},{"line_number":636,"context_line":"                continue"},{"line_number":637,"context_line":""},{"line_number":638,"context_line":"            ex_net_id \u003d (r[\u0027external_gateway_info\u0027] or {}).get(\u0027network_id\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAPH%2F%2Fj3s%3D","line":635,"in_reply_to":"AAAAPH%2F%2FkzA%3D","updated":"2013-05-31 03:46:05.000000000","message":"Same response as line 611.","commit_id":"cfd2d0bbe57c3e816f2d36c7e5a67174c8724225"},{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"unresolved":false,"context_lines":[{"line_number":170,"context_line":"            try:"},{"line_number":171,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":172,"context_line":"                                                      self.conf.router_id)"},{"line_number":173,"context_line":"                router_ids \u003d [r[\u0027id\u0027] for r in routers]"},{"line_number":174,"context_line":"            except rpc_common.RemoteError as e:"},{"line_number":175,"context_line":"                if str(e.exc_type) \u003d\u003d \u0027AgentNotFoundByTypeHost\u0027:"},{"line_number":176,"context_line":"                    LOG.info(_(\"Agent has not been registered. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fh3s%3D","line":173,"updated":"2013-05-31 06:04:03.000000000","message":"nit: let\u0027s avoid one letter variables: \u0027r\u0027\n\u0027router\u0027 will be better  :-)","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a55ac520297076734a5146af866e1343d0df653b","unresolved":false,"context_lines":[{"line_number":170,"context_line":"            try:"},{"line_number":171,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"},{"line_number":172,"context_line":"                                                      self.conf.router_id)"},{"line_number":173,"context_line":"                router_ids \u003d [r[\u0027id\u0027] for r in routers]"},{"line_number":174,"context_line":"            except rpc_common.RemoteError as e:"},{"line_number":175,"context_line":"                if str(e.exc_type) \u003d\u003d \u0027AgentNotFoundByTypeHost\u0027:"},{"line_number":176,"context_line":"                    LOG.info(_(\"Agent has not been registered. \""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2FhBY%3D","line":173,"in_reply_to":"AAAAPH%2F%2Fh3s%3D","updated":"2013-05-31 14:06:09.000000000","message":"For small 1 line list comprehensions like this, I think \u0027r\u0027 is acceptable and very common in proper python code.  A longer name could cause the statement to unnecessarily wrap.","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"a5f4b50f53abc498a457267ad0f224a573979326","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        If only_router_id is passed, only destroy single namespace, to allow"},{"line_number":197,"context_line":"        for multiple l3 agents on the same host, without stepping on each"},{"line_number":198,"context_line":"        other\u0027s toes on init.  This only makes sense if router_id is set."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":201,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2FgQs%3D","line":198,"updated":"2013-05-31 18:03:07.000000000","message":"nit: need to update doc string?","commit_id":"94697a6890ed54b10a1fa7f5c9c6855c8fbab68b"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"dee4dea82591e7e2dd6eaaaf60c7bf3b150489d9","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"        If only_router_id is passed, only destroy single namespace, to allow"},{"line_number":197,"context_line":"        for multiple l3 agents on the same host, without stepping on each"},{"line_number":198,"context_line":"        other\u0027s toes on init.  This only makes sense if router_id is set."},{"line_number":199,"context_line":"        \"\"\""},{"line_number":200,"context_line":"        root_ip \u003d ip_lib.IPWrapper(self.root_helper)"},{"line_number":201,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAPH%2F%2Ffko%3D","line":198,"in_reply_to":"AAAAPH%2F%2FgQs%3D","updated":"2013-05-31 22:18:59.000000000","message":"Done","commit_id":"94697a6890ed54b10a1fa7f5c9c6855c8fbab68b"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"dee4dea82591e7e2dd6eaaaf60c7bf3b150489d9","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                    continue"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"                if (ids_to_ignore and"},{"line_number":211,"context_line":"                        ns.strip(NS_PREFIX) in ids_to_ignore):"},{"line_number":212,"context_line":"                    continue"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAPH%2F%2Ffgs%3D","line":211,"updated":"2013-05-31 23:42:28.000000000","message":"ns.strip(\u0027qrouter-\u0027) will remove all occurrances of \u0027e\u0027 from the start and the end of the string ns.  So qrouter-uuids where the uuid that starts and/or ends with \u0027e\u0027 result in bad comparison.  This is the cause of the jenkins test error.","commit_id":"20e8f677308558762e0da7422ab8189de946b76a"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"19a624d1ff69157aca5f7bf79221a9e157aa019b","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                               \"clean-up at this time.\"))"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":181,"context_line":"                                    \"for namespace clean-up : \") + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up : \") + repr(e))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPX%2F%2Fy0A%3D","line":181,"updated":"2013-06-10 15:04:09.000000000","message":"LOG.exception() dumps all the exception info so I think you don\u0027t need to include it here one more time.","commit_id":"c42dae121bb4f3242982bfed7ee6fe1a6804d5e3"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"530985b70ff9a71f690fef1b24f5072cd326e118","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                               \"clean-up at this time.\"))"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":181,"context_line":"                                    \"for namespace clean-up : \") + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up : \") + repr(e))"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2F4t0%3D","line":181,"in_reply_to":"AAAAPX%2F%2Fy0A%3D","updated":"2013-06-18 23:34:18.000000000","message":"Done","commit_id":"c42dae121bb4f3242982bfed7ee6fe1a6804d5e3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"19a624d1ff69157aca5f7bf79221a9e157aa019b","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                    \"for namespace clean-up : \") + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up : \") + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPX%2F%2Fy0E%3D","line":184,"updated":"2013-06-10 15:04:09.000000000","message":"ditto","commit_id":"c42dae121bb4f3242982bfed7ee6fe1a6804d5e3"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"530985b70ff9a71f690fef1b24f5072cd326e118","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                    \"for namespace clean-up : \") + repr(e))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up : \") + repr(e))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAPn%2F%2F4tw%3D","line":184,"in_reply_to":"AAAAPX%2F%2Fy0E%3D","updated":"2013-06-18 23:34:18.000000000","message":"Done","commit_id":"c42dae121bb4f3242982bfed7ee6fe1a6804d5e3"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"243e8f748be07a82bc3830c4ea705dfd34cfc5b0","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                               \"clean-up at this time.\"))"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":181,"context_line":"                                    \"for namespace clean-up :\"))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up :\"))"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F4Ow%3D","line":181,"updated":"2013-06-19 06:36:36.000000000","message":"..clean-up.","commit_id":"b13dbaf213952e3cdda55cf1b434bd9e09c0d7cc"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                               \"clean-up at this time.\"))"},{"line_number":179,"context_line":"                else:"},{"line_number":180,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":181,"context_line":"                                    \"for namespace clean-up :\"))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up :\"))"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F2%2F0%3D","line":181,"in_reply_to":"AAAAPn%2F%2F4Ow%3D","updated":"2013-06-19 16:37:02.000000000","message":"Done","commit_id":"b13dbaf213952e3cdda55cf1b434bd9e09c0d7cc"},{"author":{"_account_id":5948,"name":"Oleg Bondarev","email":"obondarev@mirantis.com","username":"obondarev"},"change_message_id":"243e8f748be07a82bc3830c4ea705dfd34cfc5b0","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                    \"for namespace clean-up :\"))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up :\"))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F4Os%3D","line":184,"updated":"2013-06-19 06:36:36.000000000","message":"..clean-up.","commit_id":"b13dbaf213952e3cdda55cf1b434bd9e09c0d7cc"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                                    \"for namespace clean-up :\"))"},{"line_number":182,"context_line":"            except Exception as e:"},{"line_number":183,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":184,"context_line":"                                \"for namespace clean-up :\"))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAPn%2F%2F2%2Fw%3D","line":184,"in_reply_to":"AAAAPn%2F%2F4Os%3D","updated":"2013-06-19 16:37:02.000000000","message":"Done","commit_id":"b13dbaf213952e3cdda55cf1b434bd9e09c0d7cc"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"unresolved":false,"context_lines":[{"line_number":184,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2Fmv0%3D","line":187,"updated":"2013-06-26 21:17:06.000000000","message":"this should be ids_to_ignore\u003drouter_ids, really","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":184,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"            self._destroy_router_namespaces(self.conf.router_id,"},{"line_number":187,"context_line":"                                            router_ids)"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        super(L3NATAgent, self).__init__(host\u003dself.conf.host)"},{"line_number":190,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2FmCE%3D","line":187,"in_reply_to":"AAAAPn%2F%2Fmv0%3D","updated":"2013-06-27 14:33:44.000000000","message":"Done (Good catch).  Also applied the comment to the only_router_id argument.","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"unresolved":false,"context_lines":[{"line_number":197,"context_line":"        for multiple l3 agents on the same host, without stepping on each"},{"line_number":198,"context_line":"        other\u0027s toes on init.  This only makes sense if router_id is set."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        Ids_to_ignore is a list of router IDs whose namespaces should be"},{"line_number":201,"context_line":"        preserved across a restart. The reason is that running VMs may still"},{"line_number":202,"context_line":"        have ports using these namespaces."},{"line_number":203,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2Fmxg%3D","line":200,"updated":"2013-06-26 21:17:06.000000000","message":"this I should really be lowercase","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":197,"context_line":"        for multiple l3 agents on the same host, without stepping on each"},{"line_number":198,"context_line":"        other\u0027s toes on init.  This only makes sense if router_id is set."},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"        Ids_to_ignore is a list of router IDs whose namespaces should be"},{"line_number":201,"context_line":"        preserved across a restart. The reason is that running VMs may still"},{"line_number":202,"context_line":"        have ports using these namespaces."},{"line_number":203,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2FmCA%3D","line":200,"in_reply_to":"AAAAPn%2F%2Fmxg%3D","updated":"2013-06-27 14:33:44.000000000","message":"Done","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"unresolved":false,"context_lines":[{"line_number":207,"context_line":"                if only_router_id and not ns.endswith(only_router_id):"},{"line_number":208,"context_line":"                    continue"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"                if (ids_to_ignore and"},{"line_number":211,"context_line":"                        ns[len(NS_PREFIX):] in ids_to_ignore):"},{"line_number":212,"context_line":"                    continue"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2FmwI%3D","line":210,"updated":"2013-06-26 21:17:06.000000000","message":"I would combine the two if\u0027s in one boolean condition. It\u0027s easier to ready.","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":207,"context_line":"                if only_router_id and not ns.endswith(only_router_id):"},{"line_number":208,"context_line":"                    continue"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"                if (ids_to_ignore and"},{"line_number":211,"context_line":"                        ns[len(NS_PREFIX):] in ids_to_ignore):"},{"line_number":212,"context_line":"                    continue"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAPn%2F%2FmB8%3D","line":210,"in_reply_to":"AAAAPn%2F%2FmwI%3D","updated":"2013-06-27 14:33:44.000000000","message":"Done","commit_id":"d13c8082448635e62369fe5ac7c7fb3caccfe5cd"},{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"},{"line_number":236,"context_line":"            if ns.startswith(NS_PREFIX):"},{"line_number":237,"context_line":"                if (only_router_id and not ns.endswith(only_router_id)) or\\"},{"line_number":238,"context_line":"                   (ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore):"},{"line_number":239,"context_line":"                    continue"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FkKI%3D","line":238,"updated":"2013-06-27 17:41:14.000000000","message":"we recommend to avoid the use of \"\\\" in OpenStack code, maybe Armando could give you a better way to represent these conditionals, there were fine to me in previous version.","commit_id":"04c3c7072d480e9161715ad16d3f8be86950eca3"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"37c31a3046e4ad803cea3a16a923d40a485470d8","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"},{"line_number":236,"context_line":"            if ns.startswith(NS_PREFIX):"},{"line_number":237,"context_line":"                if (only_router_id and not ns.endswith(only_router_id)) or\\"},{"line_number":238,"context_line":"                   (ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore):"},{"line_number":239,"context_line":"                    continue"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2Fhrc%3D","line":238,"in_reply_to":"AAAAPn%2F%2FkDc%3D","updated":"2013-06-28 14:33:53.000000000","message":"Thanks.  I changed it to the first statement.","commit_id":"04c3c7072d480e9161715ad16d3f8be86950eca3"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"},{"line_number":236,"context_line":"            if ns.startswith(NS_PREFIX):"},{"line_number":237,"context_line":"                if (only_router_id and not ns.endswith(only_router_id)) or\\"},{"line_number":238,"context_line":"                   (ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore):"},{"line_number":239,"context_line":"                    continue"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAPn%2F%2FkDc%3D","line":238,"in_reply_to":"AAAAPn%2F%2FkKI%3D","updated":"2013-06-27 18:10:09.000000000","message":"This can be written like so:\n\nif (only_router_id and not ns.endswith(only_router_id) or\n    ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore):\n    continue\n\nor\n\nskip_destroy \u003d (only_router_id and not ns.endswith(only_router_id) or\n                ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore)\nif skip_destroy:\n    continue","commit_id":"04c3c7072d480e9161715ad16d3f8be86950eca3"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"e3d2a2036198a6332388f346b01887af4a166ec9","unresolved":false,"context_lines":[{"line_number":195,"context_line":"        self.plugin_rpc \u003d L3PluginApi(topics.PLUGIN, host)"},{"line_number":196,"context_line":"        self.fullsync \u003d True"},{"line_number":197,"context_line":"        self.sync_sem \u003d semaphore.Semaphore(1)"},{"line_number":198,"context_line":"        if self.conf.use_namespaces:"},{"line_number":199,"context_line":"            router_ids \u003d None"},{"line_number":200,"context_line":"            try:"},{"line_number":201,"context_line":"                routers \u003d self.plugin_rpc.get_routers(self.context,"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FeFM%3D","line":198,"updated":"2013-07-01 09:26:29.000000000","message":"we can make this simple if we have self.conf.router_id.","commit_id":"0f7cbabb32a3cde9f8593c9508948ec2cac84e43"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"e3d2a2036198a6332388f346b01887af4a166ec9","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                else:"},{"line_number":210,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":211,"context_line":"                                    \"for namespace clean-up.\"))"},{"line_number":212,"context_line":"            except Exception as e:"},{"line_number":213,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":214,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FeF0%3D","line":212,"updated":"2013-07-01 09:26:29.000000000","message":"no need for \u0027as e\u0027","commit_id":"0f7cbabb32a3cde9f8593c9508948ec2cac84e43"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"364ca1c3a85fea736dd0b5e5671596676b6d0d47","unresolved":false,"context_lines":[{"line_number":209,"context_line":"                else:"},{"line_number":210,"context_line":"                    LOG.exception(_(\"RemoteError in obtaining router-ids info \""},{"line_number":211,"context_line":"                                    \"for namespace clean-up.\"))"},{"line_number":212,"context_line":"            except Exception as e:"},{"line_number":213,"context_line":"                LOG.exception(_(\"Error in obtaining router-ids info \""},{"line_number":214,"context_line":"                                \"for namespace clean-up.\"))"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FriA%3D","line":212,"in_reply_to":"AAAAPn%2F%2FeF0%3D","updated":"2013-07-14 15:36:08.000000000","message":"Done","commit_id":"0f7cbabb32a3cde9f8593c9508948ec2cac84e43"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"e3d2a2036198a6332388f346b01887af4a166ec9","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"},{"line_number":236,"context_line":"            if ns.startswith(NS_PREFIX):"},{"line_number":237,"context_line":"                if ((only_router_id and not ns.endswith(only_router_id)) or"},{"line_number":238,"context_line":"                   (ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore)):"},{"line_number":239,"context_line":"                    continue"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAPn%2F%2FeEw%3D","line":238,"updated":"2013-07-01 09:26:29.000000000","message":"only_router_id should be conflicted with ids_to_ignore. I mean if we have only_router_id,  the ids_to_ignore should always be None.","commit_id":"0f7cbabb32a3cde9f8593c9508948ec2cac84e43"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"364ca1c3a85fea736dd0b5e5671596676b6d0d47","unresolved":false,"context_lines":[{"line_number":235,"context_line":"        for ns in root_ip.get_namespaces(self.root_helper):"},{"line_number":236,"context_line":"            if ns.startswith(NS_PREFIX):"},{"line_number":237,"context_line":"                if ((only_router_id and not ns.endswith(only_router_id)) or"},{"line_number":238,"context_line":"                   (ids_to_ignore and ns[len(NS_PREFIX):] in ids_to_ignore)):"},{"line_number":239,"context_line":"                    continue"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAP3%2F%2FriE%3D","line":238,"in_reply_to":"AAAAPn%2F%2FeEw%3D","updated":"2013-07-14 15:36:08.000000000","message":"Changed so that when only_router_id is defined, only the qrouter-\u003conly_router_id\u003e is destroyed.  And when self.conf.router_id is not defined, delete all router namespaces except those whose ids are in ids_to_ignore.","commit_id":"0f7cbabb32a3cde9f8593c9508948ec2cac84e43"}],"quantum/tests/unit/test_l3_agent.py":[{"author":{"_account_id":704,"name":"Edgar Magana","email":"emagana@gmail.com","username":"emagana"},"unresolved":false,"context_lines":[{"line_number":96,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def testAgentCreateWithCleanup(self):"},{"line_number":99,"context_line":"        self.conf.router_id \u003d _uuid()"},{"line_number":100,"context_line":"        ex_gw_port \u003d {\u0027id\u0027: _uuid(),"},{"line_number":101,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":102,"context_line":"                      \u0027fixed_ips\u0027: [{\u0027ip_address\u0027: \u002719.4.4.4\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fh6k%3D","line":99,"updated":"2013-05-31 06:04:03.000000000","message":"Is this self.conf.router_id \u003d _uuid() needed?","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"b4fe5528d517a5a488f532fe25d393b4d0e5d92b","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def testAgentCreateWithCleanup(self):"},{"line_number":99,"context_line":"        self.conf.router_id \u003d _uuid()"},{"line_number":100,"context_line":"        ex_gw_port \u003d {\u0027id\u0027: _uuid(),"},{"line_number":101,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":102,"context_line":"                      \u0027fixed_ips\u0027: [{\u0027ip_address\u0027: \u002719.4.4.4\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fgjs%3D","line":99,"in_reply_to":"AAAAPH%2F%2Fg5g%3D","updated":"2013-05-31 16:34:59.000000000","message":"Done. Yes its required.","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a55ac520297076734a5146af866e1343d0df653b","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def testAgentCreateWithCleanup(self):"},{"line_number":99,"context_line":"        self.conf.router_id \u003d _uuid()"},{"line_number":100,"context_line":"        ex_gw_port \u003d {\u0027id\u0027: _uuid(),"},{"line_number":101,"context_line":"                      \u0027network_id\u0027: _uuid(),"},{"line_number":102,"context_line":"                      \u0027fixed_ips\u0027: [{\u0027ip_address\u0027: \u002719.4.4.4\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fg5g%3D","line":99,"in_reply_to":"AAAAPH%2F%2Fh6k%3D","updated":"2013-05-31 14:06:09.000000000","message":"If it is required, this is not the correct way to set the value.\n\nself.conf.set_override(\u0027router_id\u0027, _uuid())","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a55ac520297076734a5146af866e1343d0df653b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            \u0027routes\u0027: [],"},{"line_number":124,"context_line":"            \u0027gw_port\u0027: ex_gw_port}"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        self.plugin_api.get_routers \u003d mock.Mock(return_value\u003d[router])"},{"line_number":127,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + self.conf.router_id"},{"line_number":128,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1])"},{"line_number":129,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fg4Y%3D","line":126,"updated":"2013-05-31 14:06:09.000000000","message":"self.mock_ip is already a mock object.  You should do this:\n\nself.mock_ip.get_routers.return_value \u003d [router]","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"b4fe5528d517a5a488f532fe25d393b4d0e5d92b","unresolved":false,"context_lines":[{"line_number":123,"context_line":"            \u0027routes\u0027: [],"},{"line_number":124,"context_line":"            \u0027gw_port\u0027: ex_gw_port}"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        self.plugin_api.get_routers \u003d mock.Mock(return_value\u003d[router])"},{"line_number":127,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + self.conf.router_id"},{"line_number":128,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1])"},{"line_number":129,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fgjo%3D","line":126,"in_reply_to":"AAAAPH%2F%2Fg4Y%3D","updated":"2013-05-31 16:34:59.000000000","message":"Done","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a55ac520297076734a5146af866e1343d0df653b","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        self.plugin_api.get_routers \u003d mock.Mock(return_value\u003d[router])"},{"line_number":127,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + self.conf.router_id"},{"line_number":128,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1])"},{"line_number":129,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":130,"context_line":"        self.assertEqual(self.mock_ip.get_namespaces.call_count, 1)"},{"line_number":131,"context_line":"        self.assertEqual(self.mock_ip.get_devices.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fg4c%3D","line":128,"updated":"2013-05-31 14:06:09.000000000","message":"self.mock_ip is already a mock object.  You should do this:\n\nself.mock_ip.get_namespaces.return_value \u003d [ns1, ns2, ns3]","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"b4fe5528d517a5a488f532fe25d393b4d0e5d92b","unresolved":false,"context_lines":[{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        self.plugin_api.get_routers \u003d mock.Mock(return_value\u003d[router])"},{"line_number":127,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + self.conf.router_id"},{"line_number":128,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1])"},{"line_number":129,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":130,"context_line":"        self.assertEqual(self.mock_ip.get_namespaces.call_count, 1)"},{"line_number":131,"context_line":"        self.assertEqual(self.mock_ip.get_devices.call_count, 1)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fgjk%3D","line":128,"in_reply_to":"AAAAPH%2F%2Fg4c%3D","updated":"2013-05-31 16:34:59.000000000","message":"Done","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"a55ac520297076734a5146af866e1343d0df653b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + router[\u0027id\u0027]"},{"line_number":163,"context_line":"        ns2 \u003d l3_agent.NS_PREFIX + _uuid()"},{"line_number":164,"context_line":"        ns3 \u003d l3_agent.NS_PREFIX + _uuid()"},{"line_number":165,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1, ns2, ns3])"},{"line_number":166,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":167,"context_line":"        self.assertEqual(self.mock_ip.get_namespaces.call_count, 1)"},{"line_number":168,"context_line":"        self.assertEqual(self.mock_ip.get_devices.call_count, 2)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fg4s%3D","line":165,"updated":"2013-05-31 14:06:09.000000000","message":"self.mock_ip is already a mock object.  You should do this:\n\nself.mock_ip.get_namespaces.return_value \u003d [ns1, ns2, ns3]","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"},{"author":{"_account_id":6876,"name":"stephen-ma","email":"stephenbma43@gmail.com","username":"stephen-ma"},"change_message_id":"b4fe5528d517a5a488f532fe25d393b4d0e5d92b","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        ns1 \u003d l3_agent.NS_PREFIX + router[\u0027id\u0027]"},{"line_number":163,"context_line":"        ns2 \u003d l3_agent.NS_PREFIX + _uuid()"},{"line_number":164,"context_line":"        ns3 \u003d l3_agent.NS_PREFIX + _uuid()"},{"line_number":165,"context_line":"        self.mock_ip.get_namespaces \u003d mock.Mock(return_value\u003d[ns1, ns2, ns3])"},{"line_number":166,"context_line":"        l3_agent.L3NATAgent(HOSTNAME, self.conf)"},{"line_number":167,"context_line":"        self.assertEqual(self.mock_ip.get_namespaces.call_count, 1)"},{"line_number":168,"context_line":"        self.assertEqual(self.mock_ip.get_devices.call_count, 2)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAPH%2F%2Fgjg%3D","line":165,"in_reply_to":"AAAAPH%2F%2Fg4s%3D","updated":"2013-05-31 16:34:59.000000000","message":"Done","commit_id":"88cc9367069b7950ff3535172cc13e30d035cb50"}]}
