)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     aa8cf7b6 (Merge \"Make test_l3_agent._prepare_router_data a module function\")"},{"line_number":2,"context_line":"Author:     Assaf Muller \u003camuller@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2014-07-27 17:49:49 +0300"},{"line_number":4,"context_line":"Commit:     Assaf Muller \u003camuller@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_03413463","line":1,"updated":"2014-07-29 20:29:31.000000000","message":"I think this is a great start!  I would hope that a future patch would ensure straightforward validation of the lifecycle of a router managed by the agent (create, verify existence, delete, verify removal), but that would likely require refactoring of the agent and that is probably done in a subsequent patch.\n\nIt probably makes sense to include at least a Related-bug tag.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     aa8cf7b6 (Merge \"Make test_l3_agent._prepare_router_data a module function\")"},{"line_number":2,"context_line":"Author:     Assaf Muller \u003camuller@redhat.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2014-07-27 17:49:49 +0300"},{"line_number":4,"context_line":"Commit:     Assaf Muller \u003camuller@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"baada198_63b734f9","line":1,"in_reply_to":"baada198_03413463","updated":"2014-07-30 15:28:43.000000000","message":"I\u0027ll add context and a link to the l3 ha blueprint.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"96cea776c5fd8de0fe4798e523d50eea17d232e8","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The L3 HA patch will use the framework provided here"},{"line_number":14,"context_line":"to implement additional HA specific tests."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I49ddc95a0c41330580fcec6ba05c72684248af5e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_8c305056","line":15,"updated":"2014-08-04 20:00:56.000000000","message":"Do you think it\u0027s worth referencing the BP here as a \"Partially implements\"?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The L3 HA patch will use the framework provided here"},{"line_number":14,"context_line":"to implement additional HA specific tests."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I49ddc95a0c41330580fcec6ba05c72684248af5e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_feb32032","line":15,"in_reply_to":"baada198_8c305056","updated":"2014-08-05 06:29:53.000000000","message":"I don\u0027t think there is a \u0027partially implements\u0027, but I do think the blueprint should be referenced as \u0027Implements\u0027 as per the gerrit workflow entry in the wiki.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"The L3 HA patch will use the framework provided here"},{"line_number":14,"context_line":"to implement additional HA specific tests."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I49ddc95a0c41330580fcec6ba05c72684248af5e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"baada198_1f88c46a","line":15,"in_reply_to":"baada198_feb32032","updated":"2014-08-05 14:42:19.000000000","message":"Done","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"}],"etc/neutron/rootwrap.d/l3.filters":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"5ad899027deee4fbd985ced96d8acf2f3b248b05","unresolved":false,"context_lines":[{"line_number":24,"context_line":"metadata_proxy_local: CommandFilter, /usr/local/bin/neutron-ns-metadata-proxy, root"},{"line_number":25,"context_line":"metadata_proxy_local_quantum: CommandFilter, /usr/local/bin/quantum-ns-metadata-proxy, root"},{"line_number":26,"context_line":"# RHEL invocation of the metadata proxy will report /usr/bin/python"},{"line_number":27,"context_line":"kill_metadata: KillFilter, root, python, -9"},{"line_number":28,"context_line":"kill_metadata7: KillFilter, root, python2.7, -9"},{"line_number":29,"context_line":"kill_metadata6: KillFilter, root, python2.6, -9"},{"line_number":30,"context_line":"kill_radvd_usr: KillFilter, root, /sbin/radvd, -9, -HUP"}],"source_content_type":"application/octet-stream","patch_set":24,"id":"1abeadc6_881d7976","line":27,"updated":"2014-08-18 08:29:59.000000000","message":"Done just for testing, check with Thierry Carrez.\n\nBut best option is just to handle it with @maru proposal which seems fine (no security implication, and long term help for functional testing):\n\nhttps://review.openstack.org/#/c/114717/\nhttps://review.openstack.org/#/c/114416/","commit_id":"a868c764a0b47d8d07c49b0dfef34a41ae00caa9"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b54070c78002ef08af6246f047bc1b734580cfe3","unresolved":false,"context_lines":[{"line_number":27,"context_line":"kill_metadata: KillFilter, root, python, -9"},{"line_number":28,"context_line":"kill_metadata7: KillFilter, root, python2.7, -9"},{"line_number":29,"context_line":"kill_metadata6: KillFilter, root, python2.6, -9"},{"line_number":30,"context_line":"kill_radvd_usr: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":31,"context_line":"kill_radvd: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# ip_lib"}],"source_content_type":"application/octet-stream","patch_set":24,"id":"1abeadc6_617e7de6","line":30,"updated":"2014-08-18 07:26:29.000000000","message":"I broke the /usr/ from /usr/sbin/radvd, this would need to be reverted.","commit_id":"a868c764a0b47d8d07c49b0dfef34a41ae00caa9"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"1cb98c69c674caf9d3c977ee8e56a2339499c1c8","unresolved":false,"context_lines":[{"line_number":27,"context_line":"kill_metadata: KillFilter, root, python, -9"},{"line_number":28,"context_line":"kill_metadata7: KillFilter, root, python2.7, -9"},{"line_number":29,"context_line":"kill_metadata6: KillFilter, root, python2.6, -9"},{"line_number":30,"context_line":"kill_radvd_usr: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":31,"context_line":"kill_radvd: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# ip_lib"}],"source_content_type":"application/octet-stream","patch_set":24,"id":"1abeadc6_b9f53c84","line":30,"in_reply_to":"1abeadc6_617e7de6","updated":"2014-08-24 10:39:56.000000000","message":"I\u0027m not sure why we need to change l3.filters for adding test..","commit_id":"a868c764a0b47d8d07c49b0dfef34a41ae00caa9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"e1ea438644fc680f4fac759989cb17bc0ca2ce6c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"kill_metadata: KillFilter, root, python, -9"},{"line_number":28,"context_line":"kill_metadata7: KillFilter, root, python2.7, -9"},{"line_number":29,"context_line":"kill_metadata6: KillFilter, root, python2.6, -9"},{"line_number":30,"context_line":"kill_radvd_usr: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":31,"context_line":"kill_radvd: KillFilter, root, /sbin/radvd, -9, -HUP"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# ip_lib"}],"source_content_type":"application/octet-stream","patch_set":24,"id":"1abeadc6_90c925af","line":30,"in_reply_to":"1abeadc6_b9f53c84","updated":"2014-08-25 08:52:22.000000000","message":"We don\u0027t, this patchset was a test... WIP.","commit_id":"a868c764a0b47d8d07c49b0dfef34a41ae00caa9"}],"neutron/agent/l3_agent.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d3f3bc7ddba7dcf92847bf107a5a2a269eb21862","unresolved":false,"context_lines":[{"line_number":1778,"context_line":"        LOG.info(_(\"agent_updated by server side %s!\"), payload)"},{"line_number":1779,"context_line":""},{"line_number":1780,"context_line":""},{"line_number":1781,"context_line":"def _register_opts():"},{"line_number":1782,"context_line":"    conf \u003d cfg.CONF"},{"line_number":1783,"context_line":"    conf.register_opts(L3NATAgent.OPTS)"},{"line_number":1784,"context_line":"    config.register_interface_driver_opts_helper(conf)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_a617cb50","line":1781,"updated":"2014-08-18 06:56:44.000000000","message":"provide \"conf\" as parameter, this way during testing you can create your own \"conf\" dictionary, and pass it to this function to get the opts registered, as we do in the \"config\" module (config.register_root_helper(conf))","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1655368e0e03d537245055bdc5e393f83aec3821","unresolved":false,"context_lines":[{"line_number":1778,"context_line":"        LOG.info(_(\"agent_updated by server side %s!\"), payload)"},{"line_number":1779,"context_line":""},{"line_number":1780,"context_line":""},{"line_number":1781,"context_line":"def _register_opts():"},{"line_number":1782,"context_line":"    conf \u003d cfg.CONF"},{"line_number":1783,"context_line":"    conf.register_opts(L3NATAgent.OPTS)"},{"line_number":1784,"context_line":"    config.register_interface_driver_opts_helper(conf)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_50b94deb","line":1781,"in_reply_to":"1abeadc6_a617cb50","updated":"2014-08-25 08:51:59.000000000","message":"Done","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d3f3bc7ddba7dcf92847bf107a5a2a269eb21862","unresolved":false,"context_lines":[{"line_number":1790,"context_line":""},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"def main(manager\u003d\u0027neutron.agent.l3_agent.L3NATAgentWithStateReport\u0027):"},{"line_number":1793,"context_line":"    _register_opts()"},{"line_number":1794,"context_line":"    common_config.init(sys.argv[1:])"},{"line_number":1795,"context_line":"    config.setup_logging(cfg.CONF)"},{"line_number":1796,"context_line":"    server \u003d neutron_service.Service.create("}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_0606bf20","line":1793,"updated":"2014-08-18 06:56:44.000000000","message":"_register_opts(cfg.CONF)","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1655368e0e03d537245055bdc5e393f83aec3821","unresolved":false,"context_lines":[{"line_number":1790,"context_line":""},{"line_number":1791,"context_line":""},{"line_number":1792,"context_line":"def main(manager\u003d\u0027neutron.agent.l3_agent.L3NATAgentWithStateReport\u0027):"},{"line_number":1793,"context_line":"    _register_opts()"},{"line_number":1794,"context_line":"    common_config.init(sys.argv[1:])"},{"line_number":1795,"context_line":"    config.setup_logging(cfg.CONF)"},{"line_number":1796,"context_line":"    server \u003d neutron_service.Service.create("}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_30edb1f0","line":1793,"in_reply_to":"1abeadc6_0606bf20","updated":"2014-08-25 08:51:59.000000000","message":"Done","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"}],"neutron/agent/linux/external_process.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0e8ca9f9903d455e881a8102b35a04cfaed53063","unresolved":false,"context_lines":[{"line_number":55,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(self.root_helper, self.namespace)"},{"line_number":56,"context_line":"            ip_wrapper.netns.execute(cmd)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"            LOG.error(\u0027Calling %s with pid %s, pid file %s, root_helper %s, \u0027"},{"line_number":59,"context_line":"                      \u0027namespace %s\u0027, cmd, self.pid, pid, self.root_helper,"},{"line_number":60,"context_line":"                      self.namespace)"},{"line_number":61,"context_line":"        elif reload_cfg:"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_a05a3383","line":58,"updated":"2014-08-13 14:14:16.000000000","message":"LOG.error(_(...), cmd, ...) instead.","commit_id":"34e186a746af6bc27684af1b3f6f77efdca92fdb"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0e8ca9f9903d455e881a8102b35a04cfaed53063","unresolved":false,"context_lines":[{"line_number":69,"context_line":""},{"line_number":70,"context_line":"        if self.active:"},{"line_number":71,"context_line":"            utils.execute([\u0027ps\u0027, \u0027-p\u0027, pid])  # See if the process is up"},{"line_number":72,"context_line":"            LOG.error(\u0027Killing pid %s with signal %s\u0027, pid, sig)"},{"line_number":73,"context_line":"            cmd \u003d [\u0027kill\u0027, \u0027-%s\u0027 % (sig), pid]"},{"line_number":74,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":75,"context_line":"            # In the case of shutting down, remove the pid file"}],"source_content_type":"text/x-python","patch_set":18,"id":"baada198_005aff81","line":72,"updated":"2014-08-13 14:14:16.000000000","message":"ditto","commit_id":"34e186a746af6bc27684af1b3f6f77efdca92fdb"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ee6c5578fd288fc868097b3b2b91916ca4c3d60f","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def enable(self, cmd_callback, reload_cfg\u003dFalse):"},{"line_number":51,"context_line":"        if not self.active:"},{"line_number":52,"context_line":"            pid \u003d self.get_pid_file_name(ensure_pids_dir\u003dTrue)"},{"line_number":53,"context_line":"            cmd \u003d cmd_callback(pid)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(self.root_helper, self.namespace)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7ac7a964_20899826","line":52,"updated":"2014-08-15 16:12:47.000000000","message":"nit: We\u0027ve got pids (self.pid) and pid files here.  Maybe this would be better called pid_file or pid_filename or something like that.","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"636ae39be2fbea24289c7e4486d6a3f7682aa6dd","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def enable(self, cmd_callback, reload_cfg\u003dFalse):"},{"line_number":51,"context_line":"        if not self.active:"},{"line_number":52,"context_line":"            pid \u003d self.get_pid_file_name(ensure_pids_dir\u003dTrue)"},{"line_number":53,"context_line":"            cmd \u003d cmd_callback(pid)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(self.root_helper, self.namespace)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_26ef3bb2","line":52,"in_reply_to":"7ac7a964_20899826","updated":"2014-08-18 06:36:04.000000000","message":"+1 nit","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1655368e0e03d537245055bdc5e393f83aec3821","unresolved":false,"context_lines":[{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def enable(self, cmd_callback, reload_cfg\u003dFalse):"},{"line_number":51,"context_line":"        if not self.active:"},{"line_number":52,"context_line":"            pid \u003d self.get_pid_file_name(ensure_pids_dir\u003dTrue)"},{"line_number":53,"context_line":"            cmd \u003d cmd_callback(pid)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"            ip_wrapper \u003d ip_lib.IPWrapper(self.root_helper, self.namespace)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_f0909950","line":52,"in_reply_to":"7ac7a964_20899826","updated":"2014-08-25 08:51:59.000000000","message":"This is just for debugging the gate issue. I\u0027ll revert this change now that we know what the issue is, and Maru has a fix in review.","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"d3f3bc7ddba7dcf92847bf107a5a2a269eb21862","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            LOG.error(_(\u0027Killing pid %(pid)s with signal %(sig)s\u0027),"},{"line_number":79,"context_line":"                      {\u0027pid\u0027: pid, \u0027sig\u0027: sig})"},{"line_number":80,"context_line":"            cmd \u003d [\u0027kill\u0027, \u0027-%s\u0027 % (sig), pid]"},{"line_number":81,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":82,"context_line":"            # In the case of shutting down, remove the pid file"},{"line_number":83,"context_line":"            if sig \u003d\u003d \u00279\u0027:"},{"line_number":84,"context_line":"                utils.remove_conf_file(self.conf.external_pids,"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_81cab99f","line":81,"updated":"2014-08-18 06:56:44.000000000","message":"The problem is with the rootwrap filters, it seems. The process is up, and it\u0027s the correct one.\n\n2014-08-15 08:46:07.607 | 2014-08-15 08:46:07.549 | 2014-08-15 08:45:57.067 3800 ERROR neutron.agent.linux.utils [req-279d379b-eb5b-4524-a27b-b415e422c02d None] \n2014-08-15 08:46:07.607 | 2014-08-15 08:46:07.551 | Command: [\u0027sudo\u0027, \u0027/usr/local/bin/neutron-rootwrap\u0027, \u0027/etc/neutron/rootwrap.conf\u0027, \u0027kill\u0027, \u0027-9\u0027, \u00274709\u0027]\n2014-08-15 08:46:07.608 | 2014-08-15 08:46:07.553 | Exit code: 99\n2014-08-15 08:46:07.608 | 2014-08-15 08:46:07.555 | Stdout: \u0027\u0027\n2014-08-15 08:46:07.608 | 2014-08-15 08:46:07.558 | Stderr: \u0027/usr/local/bin/neutron-rootwrap: Unauthorized command: kill -9 4709 (no filter matched)\\n\u0027\n\n\n/etc/rootwrap.d/l3.filters:\n\nl3.filters:kill_metadata: KillFilter, root, /usr/bin/python, -9\nl3.filters:kill_metadata7: KillFilter, root, /usr/bin/python2.7, -9\nl3.filters:kill_metadata6: KillFilter, root, /usr/bin/python2.6, -9\nl3.filters:kill_radvd_usr: KillFilter, root, /usr/sbin/radvd, -9, -HUP\nl3.filters:kill_radvd: KillFilter, root, /sbin/radvd, -9, -HUP\n\n\nand within tox, we get it called with the \"/opt/stack/new/neutron/.tox/dsvm-functional/bin/python\"\n\nSo it won\u0027t match the filter, \n\nCan you try adding\n\nkill_metadata_functional: KillFilter, root, /opt/stack/new/neutron/.tox/dsvm-functional/bin/python, -9\n\nto l3.filters for testing as a workaround ?\n\n\nNot sure how can we tackle this, because adding a testing rule permanently doesn\u0027t seem reasonable,\n\nmay be we should add it as a step on the CI scripts (see post_test_hook: https://github.com/openstack-infra/config/blob/master/modules/openstack_project/files/jenkins_job_builder/config/neutron-functional.yaml)\n\ntouch /etc/rootwrap.d/test.filters\necho \"KillFilter, root, /opt/stack/new/neutron/.tox/dsvm-functional/bin/python, -9\" \u003e\u003e /etc/rootwrap.d/test.filters\n..\n..\n..\n..","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"19157755e14409ff8dcd22cc3bf42f00e0d55df6","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            LOG.error(_(\u0027Killing pid %(pid)s with signal %(sig)s\u0027),"},{"line_number":79,"context_line":"                      {\u0027pid\u0027: pid, \u0027sig\u0027: sig})"},{"line_number":80,"context_line":"            cmd \u003d [\u0027kill\u0027, \u0027-%s\u0027 % (sig), pid]"},{"line_number":81,"context_line":"            utils.execute(cmd, self.root_helper)"},{"line_number":82,"context_line":"            # In the case of shutting down, remove the pid file"},{"line_number":83,"context_line":"            if sig \u003d\u003d \u00279\u0027:"},{"line_number":84,"context_line":"                utils.remove_conf_file(self.conf.external_pids,"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_a1033572","line":81,"in_reply_to":"1abeadc6_81cab99f","updated":"2014-08-18 07:10:45.000000000","message":"Given this:\n\nhttps://github.com/openstack/oslo.rootwrap/blob/master/oslo/rootwrap/filters.py#L189\n\nI tried changing:\n\nkill_metadata: KillFilter, root, /usr/bin/python, -9\nkill_metadata7: KillFilter, root, /usr/bin/python2.7, -9\nkill_metadata6: KillFilter, root, /usr/bin/python2.6, -9\n\nto:\n\nkill_metadata: KillFilter, root, python, -9\nkill_metadata7: KillFilter, root, python2.7, -9\nkill_metadata6: KillFilter, root, python2.6, -9\n\n\nWhich will match any \"python\", as long as it\u0027s in the current path.\n\nWe may ask Thierry Carrez for security implications on this, even if I don\u0027t see any, may be it was set to absolute path for a reason","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"20baf6248e9710fbd7dae6f338656cb6f44c05ee","unresolved":false,"context_lines":[{"line_number":541,"context_line":"        return False"},{"line_number":542,"context_line":""},{"line_number":543,"context_line":""},{"line_number":544,"context_line":"def device_exists(device_name, root_helper\u003dNone, namespace\u003dNone,"},{"line_number":545,"context_line":"                  expected_ip\u003dNone, expected_mac\u003dNone):"},{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_e899181f","line":544,"updated":"2014-08-01 04:38:54.000000000","message":"Would this refactor belong in a change of its own?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"20baf6248e9710fbd7dae6f338656cb6f44c05ee","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_03c54d8f","line":549,"updated":"2014-08-01 04:38:54.000000000","message":"Hmmm.  This seems to be overloading device_exists with some extra unexpected behavior.  Should we leave device_exists as is and add new methods for checking the existence of a device with the correct mac or ip address.  Maybe just in the test code since this is for test?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"7e654cd47e7b71ef5e56622776d623d7da0bbe2b","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_dd5ecd78","line":549,"in_reply_to":"baada198_03c54d8f","updated":"2014-08-01 08:16:41.000000000","message":"That\u0027s what I did in the previous patchsets. Still debating this internally...","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_de99fc7a","line":549,"in_reply_to":"baada198_cc240810","updated":"2014-08-05 06:29:53.000000000","message":"I\u0027m not of the opinion that these changes are dangerous since the new code paths only run when the new kwargs are passed - no existing client would be affected.  That said, I do agree that checks for the mac and ip appear out-of-scope for this method and would be better added in a helper method (e.g. device_configured_with).","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"544e750b5ef875648ec1e45ff4aef447212cc3fb","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_efe5490a","line":549,"in_reply_to":"baada198_dd5ecd78","updated":"2014-08-04 15:32:36.000000000","message":"I agree with Carl. If this method is needed, it is better to add a new method.\n\nIMO the goal of this patch is to add functional tests for l3-agent, so it is better such modification of the main code should be avoided as possible as we can.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_7fee2023","line":549,"in_reply_to":"baada198_de99fc7a","updated":"2014-08-05 14:42:19.000000000","message":"I\u0027ll add a new, separate method.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"96cea776c5fd8de0fe4798e523d50eea17d232e8","unresolved":false,"context_lines":[{"line_number":546,"context_line":"    try:"},{"line_number":547,"context_line":"        device \u003d IPDevice(device_name, root_helper, namespace)"},{"line_number":548,"context_line":"        device_address \u003d device.link.address"},{"line_number":549,"context_line":"        if expected_mac is not None and device_address !\u003d expected_mac:"},{"line_number":550,"context_line":"            return False"},{"line_number":551,"context_line":"        if expected_ip is not None:"},{"line_number":552,"context_line":"            existing_ip_cidrs \u003d (ip[\u0027cidr\u0027] for ip in device.addr.list())"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_cc240810","line":549,"in_reply_to":"baada198_efe5490a","updated":"2014-08-04 20:00:56.000000000","message":"Agree with Carl and Akihiro.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8089e2b8e11109d83feaac85e94e7c3b36815dbc","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    return bool(address)"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"#TODO(amuller): Add unit tests"},{"line_number":553,"context_line":"def device_configured_with(device_name, ip, mac, root_helper\u003dNone,"},{"line_number":554,"context_line":"                           namespace\u003dNone):"},{"line_number":555,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_930dab43","line":552,"updated":"2014-08-05 14:53:03.000000000","message":"i am not in favor of the addition of new code without tests\n\nplease add tests for this code. also where is it used other than in the unit tests you have added (unless I missed something)","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"af62ddd722742bbd14a8998075a41e169043561c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    return bool(address)"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"#TODO(amuller): Add unit tests"},{"line_number":553,"context_line":"def device_configured_with(device_name, ip, mac, root_helper\u003dNone,"},{"line_number":554,"context_line":"                           namespace\u003dNone):"},{"line_number":555,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_eef0c0dc","line":552,"in_reply_to":"baada198_930dab43","updated":"2014-08-05 14:56:39.000000000","message":"I\u0027ll mark the patch WIP which should your other comment as well.\n\nThis function is only used in the test for now.","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"627fba6140b4444ffd5de46ba89c496e97755a16","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    return bool(address)"},{"line_number":550,"context_line":""},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"#TODO(amuller): Add unit tests"},{"line_number":553,"context_line":"def device_configured_with(device_name, ip, mac, root_helper\u003dNone,"},{"line_number":554,"context_line":"                           namespace\u003dNone):"},{"line_number":555,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_2a56162c","line":552,"in_reply_to":"baada198_eef0c0dc","updated":"2014-08-05 21:09:08.000000000","message":"I moved this function to a separate patchset (Previous to this in the dependency chain) with a functional test.","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"}],"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                     {\u0027chain\u0027: chain, \u0027rule\u0027: rule,"},{"line_number":237,"context_line":"                      \u0027top\u0027: top, \u0027wrap\u0027: wrap})"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def _get_chain_rules(self, chain, wrap\u003dTrue):"},{"line_number":240,"context_line":"        chain \u003d get_chain_name(chain, wrap)"},{"line_number":241,"context_line":"        return [rule for rule in self.rules"},{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5b533edd","line":239,"updated":"2014-08-05 06:29:53.000000000","message":"If all the callers know to pass wrap, and this is an internal method, does it still make sense to set a default here?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":236,"context_line":"                     {\u0027chain\u0027: chain, \u0027rule\u0027: rule,"},{"line_number":237,"context_line":"                      \u0027top\u0027: top, \u0027wrap\u0027: wrap})"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    def _get_chain_rules(self, chain, wrap\u003dTrue):"},{"line_number":240,"context_line":"        chain \u003d get_chain_name(chain, wrap)"},{"line_number":241,"context_line":"        return [rule for rule in self.rules"},{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1f18c4cc","line":239,"in_reply_to":"baada198_5b533edd","updated":"2014-08-05 14:42:19.000000000","message":"You\u0027re correct it\u0027s better to be explicit here.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"20baf6248e9710fbd7dae6f338656cb6f44c05ee","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) is []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_8817bc9c","line":245,"updated":"2014-08-01 04:38:54.000000000","message":"I don\u0027t think this does what you want it to.  \"... is []\" will always be False because the left side can never be the same object as the new empty list you construct on the right side.  You should probably use \u003d\u003d.\n\nThe \"is\" operator does not check equality.  Rather, it checks that the underlying object referenced is the same one.\n\n\u003e\u003e\u003e [] is []\nFalse\n\n\u003e\u003e\u003e [] \u003d\u003d []\nTrue","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"544e750b5ef875648ec1e45ff4aef447212cc3fb","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) is []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_af7d1120","line":245,"in_reply_to":"baada198_7d4f81be","updated":"2014-08-04 15:32:36.000000000","message":"Though you may have modified the code already, it can be:\n\n  return not self._get_chain_rules(chain, wrap)","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"7e654cd47e7b71ef5e56622776d623d7da0bbe2b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) is []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_7d4f81be","line":245,"in_reply_to":"baada198_8817bc9c","updated":"2014-08-01 08:16:41.000000000","message":"Gah, I remembered that [] acted like None in this context, thank you.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) is []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_df4bacb0","line":245,"in_reply_to":"baada198_af7d1120","updated":"2014-08-05 14:42:19.000000000","message":"I prefer to be more explicit and test for equality with the empty list. It\u0027s a tiny detail but I think it\u0027s more readable, and doesn\u0027t require an extra \u0027mental\u0027 leap.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"20baf6248e9710fbd7dae6f338656cb6f44c05ee","unresolved":false,"context_lines":[{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"            return requested_table.is_chain_empty(chain, wrap)"},{"line_number":362,"context_line":"        except AttributeError:"},{"line_number":363,"context_line":"            return True"},{"line_number":364,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_a8164056","line":361,"updated":"2014-08-01 04:38:54.000000000","message":"Should this go outside of the try?  I imagine the AttributeError would be thrown from L360.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"7e654cd47e7b71ef5e56622776d623d7da0bbe2b","unresolved":false,"context_lines":[{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"            return requested_table.is_chain_empty(chain, wrap)"},{"line_number":362,"context_line":"        except AttributeError:"},{"line_number":363,"context_line":"            return True"},{"line_number":364,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_fdcab118","line":361,"in_reply_to":"baada198_a8164056","updated":"2014-08-01 08:16:41.000000000","message":"To be honest I made a lot of changes here in the latest patchset, I\u0027ll have to revisit this.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"            return requested_table.is_chain_empty(chain, wrap)"},{"line_number":362,"context_line":"        except AttributeError:"},{"line_number":363,"context_line":"            return True"},{"line_number":364,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5b0a5ed1","line":361,"in_reply_to":"baada198_fdcab118","updated":"2014-08-05 06:29:53.000000000","message":"+1 to reducing the scope of the try/except","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"20baf6248e9710fbd7dae6f338656cb6f44c05ee","unresolved":false,"context_lines":[{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"            return requested_table.is_chain_empty(chain, wrap)"},{"line_number":362,"context_line":"        except AttributeError:"},{"line_number":363,"context_line":"            return True"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    def defer_apply_on(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_c84d349b","line":362,"updated":"2014-08-01 04:38:54.000000000","message":"maybe KeyError?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"7e654cd47e7b71ef5e56622776d623d7da0bbe2b","unresolved":false,"context_lines":[{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"            return requested_table.is_chain_empty(chain, wrap)"},{"line_number":362,"context_line":"        except AttributeError:"},{"line_number":363,"context_line":"            return True"},{"line_number":364,"context_line":""},{"line_number":365,"context_line":"    def defer_apply_on(self):"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1dccc533","line":362,"in_reply_to":"baada198_c84d349b","updated":"2014-08-01 08:16:41.000000000","message":"Ditto.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"20341d987f5b6b6615adf979f227c6c7688e473b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) \u003d\u003d []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_ff6c18d2","line":245,"updated":"2014-08-29 13:20:41.000000000","message":"(suggestion only) We usually use\n\n  return not self._get_chain_rules(...)\n\nin this case.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8e70628796d98f8f96126c4addfde74747164e","unresolved":false,"context_lines":[{"line_number":242,"context_line":"                if rule.chain \u003d\u003d chain and rule.wrap \u003d\u003d wrap]"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":"    def is_chain_empty(self, chain, wrap\u003dTrue):"},{"line_number":245,"context_line":"        return self._get_chain_rules(chain, wrap) \u003d\u003d []"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def empty_chain(self, chain, wrap\u003dTrue):"},{"line_number":248,"context_line":"        \"\"\"Remove all rules from a chain.\"\"\""}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_f533595f","line":245,"in_reply_to":"1abeadc6_ff6c18d2","updated":"2014-08-29 14:29:26.000000000","message":"Done","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"20341d987f5b6b6615adf979f227c6c7688e473b","unresolved":false,"context_lines":[{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"        except KeyError:"},{"line_number":362,"context_line":"            return True"},{"line_number":363,"context_line":"        return requested_table.is_chain_empty(chain, wrap)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_ff7a5875","line":360,"updated":"2014-08-29 13:20:41.000000000","message":"How about defining {4: self.ipv4, 6:self.ipv6} as an instance variable in __init__? I think it improves the code readability.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6ef088aa5c52eff117af9eda7bb66f7d929ea714","unresolved":false,"context_lines":[{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"        except KeyError:"},{"line_number":362,"context_line":"            return True"},{"line_number":363,"context_line":"        return requested_table.is_chain_empty(chain, wrap)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_6be3eaa3","line":360,"in_reply_to":"1abeadc6_356f912c","updated":"2014-08-29 15:12:15.000000000","message":"It works for me too.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8e70628796d98f8f96126c4addfde74747164e","unresolved":false,"context_lines":[{"line_number":357,"context_line":""},{"line_number":358,"context_line":"    def is_chain_empty(self, table, chain, ip_version\u003d4, wrap\u003dTrue):"},{"line_number":359,"context_line":"        try:"},{"line_number":360,"context_line":"            requested_table \u003d {4: self.ipv4, 6: self.ipv6}[ip_version][table]"},{"line_number":361,"context_line":"        except KeyError:"},{"line_number":362,"context_line":"            return True"},{"line_number":363,"context_line":"        return requested_table.is_chain_empty(chain, wrap)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_356f912c","line":360,"in_reply_to":"1abeadc6_ff7a5875","updated":"2014-08-29 14:29:26.000000000","message":"requested_table is used only here as a map between an ip_version and a table. I don\u0027t like changing it to an instance member because it\u0027s only used here. I can change the line maybe to:\n\nrequested_table \u003d self.ipv4[table] if ip_version\u003d4 else self.ipv6[table]\n\nWhat do you think?","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"}],"neutron/tests/etc/l3_agent.ini.test":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"8f841eea564ad7a8eb908f9b7ae7f7de1fe9edf6","unresolved":false,"context_lines":[{"line_number":1,"context_line":"[DEFAULT]"},{"line_number":2,"context_line":"interface_driver \u003d neutron.agent.linux.interface.OVSInterfaceDriver"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"root_helper \u003d sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"debug \u003d True"}],"source_content_type":"application/octet-stream","patch_set":2,"id":"baada198_a1bfe05e","line":3,"updated":"2014-07-28 14:40:14.000000000","message":"Not 100% about this line.","commit_id":"1a7b49eeb83aef1701f4af145621797d2440f8f5"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"8d99e8a53cd406e87b7a0731eb79ca63e92ebd5a","unresolved":false,"context_lines":[{"line_number":1,"context_line":"[DEFAULT]"},{"line_number":2,"context_line":"interface_driver \u003d neutron.agent.linux.interface.OVSInterfaceDriver"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"root_helper \u003d sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"debug \u003d True"}],"source_content_type":"application/octet-stream","patch_set":3,"id":"baada198_d6401537","line":3,"updated":"2014-07-28 15:06:59.000000000","message":"Not sure about this configuration.","commit_id":"f40a3bb5c5ac7ffb84fc20501f9940dda006ee99"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"81e5e24478577a08105140fc2df49254195a5dde","unresolved":false,"context_lines":[{"line_number":1,"context_line":"[DEFAULT]"},{"line_number":2,"context_line":"interface_driver \u003d neutron.agent.linux.interface.OVSInterfaceDriver"},{"line_number":3,"context_line":""},{"line_number":4,"context_line":"root_helper \u003d sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf"},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"debug \u003d True"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"baada198_6726b5bb","line":3,"updated":"2014-07-28 16:13:50.000000000","message":"Not sure about this configuration.","commit_id":"9ab0486341bfc0d53259b8c8fe2aae627e2499ba"}],"neutron/tests/functional/agent/test_l3_agent.py":[{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"40b7b0e8b5c42c5cf3297732c94f8d2197e053ab","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # What\u0027s the proper way of doing this?"},{"line_number":50,"context_line":"        self.conf([\u0027--config-file\u003d/etc/neutron/l3_agent.ini\u0027,"},{"line_number":51,"context_line":"                   \u0027--config-file\u003d/etc/neutron/neutron.conf\u0027])"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027)"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_086e05c8","line":51,"updated":"2014-07-28 01:48:42.000000000","message":"Hmmm. This makes the tests dependent on external configuration. I think you should put fixed config values in neutron/tests/etc/neutron.conf.test","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4c692c867967351e24dcaaef8234390b6b651a31","unresolved":false,"context_lines":[{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # What\u0027s the proper way of doing this?"},{"line_number":50,"context_line":"        self.conf([\u0027--config-file\u003d/etc/neutron/l3_agent.ini\u0027,"},{"line_number":51,"context_line":"                   \u0027--config-file\u003d/etc/neutron/neutron.conf\u0027])"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027)"},{"line_number":54,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_3b021f0c","line":51,"in_reply_to":"baada198_086e05c8","updated":"2014-07-28 13:56:39.000000000","message":"I\u0027ll try that.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"40b7b0e8b5c42c5cf3297732c94f8d2197e053ab","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_8887755a","line":60,"updated":"2014-07-28 01:48:42.000000000","message":"If a test fails the namespace is not cleaned up. I think you need to have the creation of namespaces under more direct control of the tests.\n\nTake a look at what I did in my functional tests for radvd, https://review.openstack.org/109889 . If it is of use to you, I can split out the namespace test class into a separate review so yours can depend on it.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"4c692c867967351e24dcaaef8234390b6b651a31","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_bb0e2f3b","line":60,"in_reply_to":"baada198_2c02ef0b","updated":"2014-07-28 13:56:39.000000000","message":"Pretty weird, I changed check_bridge_exists to raise an exception if the bridge was found, and the namespaces were still cleared. I\u0027ll move the configuration into the Neutron tree, let\u0027s see if this still happens.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"c29bb6efa2f91f4e6650317461324689e50a0e37","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_ec98fe1c","line":60,"in_reply_to":"baada198_8887755a","updated":"2014-07-28 08:31:37.000000000","message":"I use a context manager to create the router and _router_removed is in a finally block (Lines 91 to 101). I tested it on my setup and if a test fails then the router resources (Including the namespace) are removed correctly. This of course assumes that _router_removed itself will work.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"dde34a845d458c24b48aa09e86b63ad03c99d2bf","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_c6e4eaa9","line":60,"in_reply_to":"baada198_bb0e2f3b","updated":"2014-07-28 14:13:26.000000000","message":"Oh, maybe it\u0027s because I have:\nrouter_delete_namespaces \u003d True\nin l3_agent.ini?\n\nCan you check if the namespaces are empty on your system? I suspect they\u0027ll have only the loopback device. If that\u0027s the case, we\u0027re fine.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"63af4eca235cf4c0b48a6c0759a6a767d3c88679","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_c153f413","line":60,"in_reply_to":"baada198_c6e4eaa9","updated":"2014-07-28 14:20:59.000000000","message":"One more thing I forgot, this test is supposed to run with tox -e dsvm-functional, which per TESTING.rst is supposed to have an environment configured by devstack. Personally I think it\u0027s ok for some tests to rely on a fully configured system (Devstack all-in-one for example). There\u0027s a few questions here though - Can the dependencies in these tests be fulfilled easily? For example would creating br-int alone suffice? Can the dependencies be asserted and otherwise the tests will be skipped? Right now I\u0027m just running these tests on an all-in-one devstack but I\u0027ll try to figure out now what are the minimal set of dependencies required.","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":6524,"name":"Henry Gessau","email":"HenryG@gessau.net","username":"gessau"},"change_message_id":"3005e6b4fd356cf5753313c85477dfd09bc3eeab","unresolved":false,"context_lines":[{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def test_router_added(self):"},{"line_number":59,"context_line":"        with self.create_router() as ri:"},{"line_number":60,"context_line":"            # Check that the router namespace was created"},{"line_number":61,"context_line":"            ip \u003d ip_lib.IPWrapper(self.root_helper, ri.ns_name)"},{"line_number":62,"context_line":"            self.assertTrue(ip.netns.exists(ri.ns_name))"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"baada198_2c02ef0b","line":60,"in_reply_to":"baada198_ec98fe1c","updated":"2014-07-28 12:01:23.000000000","message":"Here is what I am seeing:\n\n $ sudo ip netns list\n $ OS_SUDO_TESTING\u003d1 tox -e functional\n      ... errors with \"BridgeDoesNotExist: Bridge br-int does not exist.\" [1]\n $ sudo ip netns list\n qrouter-32ef39ab-34f4-47db-a7cb-c981e7caedb6\n qrouter-7e02c551-b698-40e0-8b2d-d0f7184300e4\n $\n\nI think the bridge problem is due to the config, so some tighter control of the test environment is needed.\n\n[1] http://paste.openstack.org/show/88671/","commit_id":"62cbeb5388d6b9477438ff75f170b283ea72ead9"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class L3AgentTestFramework(base.BaseLinuxTestCase):"},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":40,"context_line":"        self.check_sudo_enabled()"},{"line_number":41,"context_line":"        self.conf \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_7d160ff4","line":38,"updated":"2014-07-29 20:29:31.000000000","message":"There is no setup here of the integration bridge - it should be managed by this test.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class L3AgentTestFramework(base.BaseLinuxTestCase):"},{"line_number":38,"context_line":"    def setUp(self):"},{"line_number":39,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":40,"context_line":"        self.check_sudo_enabled()"},{"line_number":41,"context_line":"        self.conf \u003d cfg.CONF"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_a3a86c8d","line":38,"in_reply_to":"baada198_7d160ff4","updated":"2014-07-30 15:28:43.000000000","message":"Done","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.check_sudo_enabled()"},{"line_number":41,"context_line":"        self.conf \u003d cfg.CONF"},{"line_number":42,"context_line":"        self.conf.register_opts(l3_agent.L3NATAgent.OPTS)"},{"line_number":43,"context_line":"        config.register_interface_driver_opts_helper(self.conf)"},{"line_number":44,"context_line":"        config.register_use_namespaces_opts_helper(self.conf)"},{"line_number":45,"context_line":"        config.register_agent_state_opts_helper(self.conf)"},{"line_number":46,"context_line":"        config.register_root_helper(self.conf)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_f7fa3e76","line":43,"updated":"2014-07-29 20:29:31.000000000","message":"(Suggestion only) Consider separating configuration of the agent into a separate function for clarity and calling it from setUp().","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        self.check_sudo_enabled()"},{"line_number":41,"context_line":"        self.conf \u003d cfg.CONF"},{"line_number":42,"context_line":"        self.conf.register_opts(l3_agent.L3NATAgent.OPTS)"},{"line_number":43,"context_line":"        config.register_interface_driver_opts_helper(self.conf)"},{"line_number":44,"context_line":"        config.register_use_namespaces_opts_helper(self.conf)"},{"line_number":45,"context_line":"        config.register_agent_state_opts_helper(self.conf)"},{"line_number":46,"context_line":"        config.register_root_helper(self.conf)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_43c0704a","line":43,"in_reply_to":"baada198_f7fa3e76","updated":"2014-07-30 15:28:43.000000000","message":"Done","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.conf.register_opts(external_process.OPTS)"},{"line_number":49,"context_line":"        config.setup_logging(self.conf)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.config_parse("},{"line_number":52,"context_line":"            self.conf,"},{"line_number":53,"context_line":"            [\u0027--config-file\u0027, tests_base.etcdir(\u0027neutron.conf.test\u0027),"},{"line_number":54,"context_line":"             \u0027--config-file\u0027, tests_base.etcdir(\u0027l3_agent.ini.test\u0027)])"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_3de3b707","line":51,"updated":"2014-07-29 20:29:31.000000000","message":"Please avoid loading config - everything here can be set in the code directly.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.conf.register_opts(external_process.OPTS)"},{"line_number":49,"context_line":"        config.setup_logging(self.conf)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.config_parse("},{"line_number":52,"context_line":"            self.conf,"},{"line_number":53,"context_line":"            [\u0027--config-file\u0027, tests_base.etcdir(\u0027neutron.conf.test\u0027),"},{"line_number":54,"context_line":"             \u0027--config-file\u0027, tests_base.etcdir(\u0027l3_agent.ini.test\u0027)])"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_e3918454","line":51,"in_reply_to":"baada198_3de3b707","updated":"2014-07-30 15:28:43.000000000","message":"Done","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"7be007fafd87a6f2e3bfd86c1c91d961071a83da","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        self.conf.register_opts(external_process.OPTS)"},{"line_number":49,"context_line":"        config.setup_logging(self.conf)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        self.config_parse("},{"line_number":52,"context_line":"            self.conf,"},{"line_number":53,"context_line":"            [\u0027--config-file\u0027, tests_base.etcdir(\u0027neutron.conf.test\u0027),"},{"line_number":54,"context_line":"             \u0027--config-file\u0027, tests_base.etcdir(\u0027l3_agent.ini.test\u0027)])"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_b3262f66","line":51,"in_reply_to":"baada198_e3918454","updated":"2014-08-05 14:37:43.000000000","message":"Yes, I was having the same thought during the design of: https://review.openstack.org/#/c/112010/1/neutron/tests/subprocess.py\n\nI ended up providing a class that rendered the config files from code.\n\nHaving the settings on code, let you see the settings needed for the test at one sight.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.plugin_rpc \u003d mock.patch.object(self.agent, \u0027plugin_rpc\u0027).start()"},{"line_number":59,"context_line":"        self.root_helper \u003d self.conf.root_helper"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @contextlib.contextmanager"},{"line_number":62,"context_line":"    def create_router(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_dd063bcd","line":59,"updated":"2014-07-29 20:29:31.000000000","message":"Use the rootwrap supplied by the base class to ensure that things will work in the gate.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027)"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        self.plugin_rpc \u003d mock.patch.object(self.agent, \u0027plugin_rpc\u0027).start()"},{"line_number":59,"context_line":"        self.root_helper \u003d self.conf.root_helper"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @contextlib.contextmanager"},{"line_number":62,"context_line":"    def create_router(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_239c5c6a","line":59,"in_reply_to":"baada198_dd063bcd","updated":"2014-07-30 15:28:43.000000000","message":"Done","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.plugin_rpc \u003d mock.patch.object(self.agent, \u0027plugin_rpc\u0027).start()"},{"line_number":59,"context_line":"        self.root_helper \u003d self.conf.root_helper"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @contextlib.contextmanager"},{"line_number":62,"context_line":"    def create_router(self):"},{"line_number":63,"context_line":"        try:"},{"line_number":64,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_37691627","line":61,"updated":"2014-07-29 20:29:31.000000000","message":"Do not use a contextmanager here.  Db state is thrown away automatically, and validation of deletion should be explicit anyway.\n\nReference: https://github.com/openstack/neutron-specs/blob/master/specs/juno/remove-unit-test-autodeletion.rst","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.plugin_rpc \u003d mock.patch.object(self.agent, \u0027plugin_rpc\u0027).start()"},{"line_number":59,"context_line":"        self.root_helper \u003d self.conf.root_helper"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @contextlib.contextmanager"},{"line_number":62,"context_line":"    def create_router(self):"},{"line_number":63,"context_line":"        try:"},{"line_number":64,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_8682964f","line":61,"in_reply_to":"baada198_37691627","updated":"2014-07-30 15:28:43.000000000","message":"We\u0027ve talked about this and I\u0027ve had some to process - I think it\u0027s correct to use a context manager in this case. The DB state has nothing to do with this discussion of course. Assuming a deletion test exists, the context manager debate is purely about readability and semantics.\n\nI think that if the goal is to ensure that every router that\u0027s created as part of a test is automatically cleaned up then a context manager is the perfect Python construct to achieve that. Giant try/finally blocks in every test would be ugly, and as a 3rd party observer, the first thing I\u0027d do looking at code like that would be to refactor it to use a context manager.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f65801bdf56650b48fc2f4177a63eb3d4d9b555f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        self.plugin_rpc \u003d mock.patch.object(self.agent, \u0027plugin_rpc\u0027).start()"},{"line_number":59,"context_line":"        self.root_helper \u003d self.conf.root_helper"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @contextlib.contextmanager"},{"line_number":62,"context_line":"    def create_router(self):"},{"line_number":63,"context_line":"        try:"},{"line_number":64,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_e6542024","line":61,"in_reply_to":"baada198_8682964f","updated":"2014-07-30 21:00:53.000000000","message":"I\u0027ll have to reserve judgement on your proposed approach until after I see the validation of deletion.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            self.agent._router_removed(router[\u0027id\u0027])"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @staticmethod"},{"line_number":74,"context_line":"    def device_exists(expected_device, name_getter, root_helper, namespace):"},{"line_number":75,"context_line":"        # Compare device names, IP addresses, subnet masks and MAC addresses"},{"line_number":76,"context_line":"        device_name \u003d name_getter(expected_device[\u0027id\u0027])"},{"line_number":77,"context_line":"        ip_cidr \u003d expected_device[\u0027ip_cidr\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_77a9ce7b","line":74,"updated":"2014-07-29 20:29:31.000000000","message":"Is there a reason this function doesn\u0027t belong in ip lib if it doesn\u0027t exist there already?","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"f65801bdf56650b48fc2f4177a63eb3d4d9b555f","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            self.agent._router_removed(router[\u0027id\u0027])"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @staticmethod"},{"line_number":74,"context_line":"    def device_exists(expected_device, name_getter, root_helper, namespace):"},{"line_number":75,"context_line":"        # Compare device names, IP addresses, subnet masks and MAC addresses"},{"line_number":76,"context_line":"        device_name \u003d name_getter(expected_device[\u0027id\u0027])"},{"line_number":77,"context_line":"        ip_cidr \u003d expected_device[\u0027ip_cidr\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_217fe26a","line":74,"in_reply_to":"baada198_436eb065","updated":"2014-07-30 21:00:53.000000000","message":"I think my concern centers around the fact that this functionality looks like it could be useful elsewhere, and that it doesn\u0027t have to depend on RouterInfo, but maybe it\u0027s too early to worry about that when so few functional tests exist.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":71,"context_line":"            self.agent._router_removed(router[\u0027id\u0027])"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    @staticmethod"},{"line_number":74,"context_line":"    def device_exists(expected_device, name_getter, root_helper, namespace):"},{"line_number":75,"context_line":"        # Compare device names, IP addresses, subnet masks and MAC addresses"},{"line_number":76,"context_line":"        device_name \u003d name_getter(expected_device[\u0027id\u0027])"},{"line_number":77,"context_line":"        ip_cidr \u003d expected_device[\u0027ip_cidr\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_436eb065","line":74,"in_reply_to":"baada198_77a9ce7b","updated":"2014-07-30 15:28:43.000000000","message":"It doesn\u0027t exist in ip_lib.\n\nI think this method makes more sense in the testing context as it compares \u0027expected_device\u0027, from a \u0027l3_agent:RouterInfo\u0027 object to an IPDevice object. I don\u0027t think RouterInfo specific constructs belong in ip_lib.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def is_chain_empty(table, chain, root_helper, namespace):"},{"line_number":93,"context_line":"    \"\"\"Returns True if chain doesn\u0027t exist or is empty.\"\"\""},{"line_number":94,"context_line":"    cmd \u003d ([\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, namespace] +"},{"line_number":95,"context_line":"           [\u0027iptables\u0027, \u0027-t\u0027, table, \u0027-nvL\u0027, chain])"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_97bd82b4","line":92,"updated":"2014-07-29 20:29:31.000000000","message":"Same comment as above.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return True"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def is_chain_empty(table, chain, root_helper, namespace):"},{"line_number":93,"context_line":"    \"\"\"Returns True if chain doesn\u0027t exist or is empty.\"\"\""},{"line_number":94,"context_line":"    cmd \u003d ([\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, namespace] +"},{"line_number":95,"context_line":"           [\u0027iptables\u0027, \u0027-t\u0027, table, \u0027-nvL\u0027, chain])"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_838fe821","line":92,"in_reply_to":"baada198_97bd82b4","updated":"2014-07-30 15:28:43.000000000","message":"This might make sense in ip_lib, I\u0027ll look into it.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"cac3cf5bb505254b8220be8b557ee920546b1e04","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return True"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"class L3AgentTestCase(L3AgentTestFramework):"},{"line_number":104,"context_line":"    def test_router_added(self):"},{"line_number":105,"context_line":"        with self.create_router() as router:"},{"line_number":106,"context_line":"            # Check that the router namespace was created"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_9d4e8337","line":103,"updated":"2014-07-29 20:29:31.000000000","message":"I would expect to see an explicit test for deletion.","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"521ded9a6dfd375f9bf422689a9b7e369e3126b4","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        return True"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"class L3AgentTestCase(L3AgentTestFramework):"},{"line_number":104,"context_line":"    def test_router_added(self):"},{"line_number":105,"context_line":"        with self.create_router() as router:"},{"line_number":106,"context_line":"            # Check that the router namespace was created"}],"source_content_type":"text/x-python","patch_set":5,"id":"baada198_a396ac3c","line":103,"in_reply_to":"baada198_9d4e8337","updated":"2014-07-30 15:28:43.000000000","message":"Done","commit_id":"0ece022505b1263d8e9d7cd121eff3dc13e69eed"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2df80363ae36c495bbc453a43c7ff2e33670320a","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        config.register_root_helper(self.conf)"},{"line_number":48,"context_line":"        self.conf.register_opts(interface.OPTS)"},{"line_number":49,"context_line":"        self.conf.register_opts(external_process.OPTS)"},{"line_number":50,"context_line":"        config.setup_logging(self.conf)"},{"line_number":51,"context_line":"        self.conf.set_override("},{"line_number":52,"context_line":"            \u0027interface_driver\u0027,"},{"line_number":53,"context_line":"            \u0027neutron.agent.linux.interface.OVSInterfaceDriver\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5837b2af","line":50,"updated":"2014-08-05 14:21:32.000000000","message":"IMO, we could modify the l3 agent too, to have a function to do all this config registrations, so we just call it... if the needed configurations change at l3 agent then this code doesn\u0027t need to be maintained individually too...\n\nhttps://github.com/openstack/neutron/blob/master/neutron/agent/l3_agent.py#L1762","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        config.register_root_helper(self.conf)"},{"line_number":48,"context_line":"        self.conf.register_opts(interface.OPTS)"},{"line_number":49,"context_line":"        self.conf.register_opts(external_process.OPTS)"},{"line_number":50,"context_line":"        config.setup_logging(self.conf)"},{"line_number":51,"context_line":"        self.conf.set_override("},{"line_number":52,"context_line":"            \u0027interface_driver\u0027,"},{"line_number":53,"context_line":"            \u0027neutron.agent.linux.interface.OVSInterfaceDriver\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_d3cba349","line":50,"in_reply_to":"baada198_5837b2af","updated":"2014-08-05 14:42:19.000000000","message":"Good point.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    @contextlib.contextmanager"},{"line_number":68,"context_line":"    def create_router(self):"},{"line_number":69,"context_line":"        try:"},{"line_number":70,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"},{"line_number":71,"context_line":"            self.agent._router_added(router[\u0027id\u0027], router)"},{"line_number":72,"context_line":"            ri \u003d self.agent.router_info[router[\u0027id\u0027]]"},{"line_number":73,"context_line":"            ri.router \u003d router"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_5e1b2c6e","line":70,"updated":"2014-08-05 06:29:53.000000000","message":"This code is a good indication of just how badly the l3 agent is written.  It should be possible to create a router without so much error-prone code, such that router addition is binary (i.e. succeeds or fails, and if it fails, it does best-effort to clean up after itself).  I\u0027d rather see that underlying problem fixed than have to rely on try/finally - the code should ideally look something like the following (no context manager required):\n\ndef create_router(self):\n  router_data \u003d ...\n  router \u003d self.agent.create_router(router_data)\n  def router_cleanup():\n     try:\n       self.agent.delete_router(router)\n     except ???:\n        pass # Already deleted\n  self.addCleanup(router_cleanup)\n\nThis would require callers to perform deletion explicitly, and I think that simplicity is desirable.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    @contextlib.contextmanager"},{"line_number":68,"context_line":"    def create_router(self):"},{"line_number":69,"context_line":"        try:"},{"line_number":70,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"},{"line_number":71,"context_line":"            self.agent._router_added(router[\u0027id\u0027], router)"},{"line_number":72,"context_line":"            ri \u003d self.agent.router_info[router[\u0027id\u0027]]"},{"line_number":73,"context_line":"            ri.router \u003d router"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_629be7c8","line":70,"in_reply_to":"baada198_5e1b2c6e","updated":"2014-08-05 14:42:19.000000000","message":"Changing how a router is created in the l3 agent is out of scope for both this patch and the l3 ha blueprint - I\u0027d rather not touch the non-HA parts of the agent. Even looking ahead, I\u0027m not convinced that the refactor you\u0027re suggesting is important enough to work on.\n\nAbout the clean up, I can move from a context manager to an addCleanup model easily enough, but I don\u0027t really understand why. The create_router implementation you\u0027ve outlined above still means that the caller does *not* have to delete explicitly, he just calls create_router and it (also) hides the clean up from him. I\u0027ve given this more thought and I\u0027m still convinced that the semantics you\u0027re looking for (Creation and auto deletion of a resource) are best achieved with a context manager. I don\u0027t see any technical upside or downside to both approaches. The only difference I see is in semantics and expectations. If I were to use a create_router context manager without looking at its implementation I would expect automatic clean up to occur, and I could not say the same for a non-context manager \u0027create_router\u0027 implementation. How could I guess that addCleanup is called internally? At the end of the day, all of this doesn\u0027t matter to me. If you still think that an addCleanup model is better I\u0027ll change to it.\n\nSorry for my typical verbosity.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            router.ns_name)"},{"line_number":101,"context_line":"        return pm.active"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bb57fa25","line":103,"updated":"2014-08-05 06:29:53.000000000","message":"The code in this method would seem to be a router health check - maybe it would more properly belong on the l3 agent and simply be called by this test, e.g.\n\nrouter \u003d self.create_router()\nself.assertTrue(is_router_healthy(router))\nself.delete_router(router)","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"89754f8204fb58981c9f4d4aa809f70d3e8be313","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            router.ns_name)"},{"line_number":101,"context_line":"        return pm.active"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_73b657dd","line":103,"in_reply_to":"baada198_bb57fa25","updated":"2014-08-05 14:39:30.000000000","message":"+1, and that would clear up the branching problems below..","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            router.ns_name)"},{"line_number":101,"context_line":"        return pm.active"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1597c346","line":103,"in_reply_to":"baada198_bb57fa25","updated":"2014-08-05 14:42:19.000000000","message":"How would is_router_healthy be useful outside of a testing context? And if you move this code to the agent, how would you test it?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"544e750b5ef875648ec1e45ff4aef447212cc3fb","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"},{"line_number":107,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":108,"context_line":"                self.assertTrue(self._metadata_proxy_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_8f33ed11","line":105,"updated":"2014-08-04 15:32:36.000000000","message":"I feel a bit confused because we have if-clause in the test case. I think the test should be deterministic. Why do we need \"if\" condition here?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"},{"line_number":107,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":108,"context_line":"                self.assertTrue(self._metadata_proxy_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_fb941242","line":105,"in_reply_to":"baada198_8f33ed11","updated":"2014-08-05 06:29:53.000000000","message":"+1 - Conditionals like this don\u0027t belong in a test method.  Router addition at the functional level should be making sure that everything is tied together rather than validating every possible code path.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_router_lifecycle(self):"},{"line_number":104,"context_line":"        with self.create_router() as router:"},{"line_number":105,"context_line":"            if router.use_namespaces:"},{"line_number":106,"context_line":"                self.assertTrue(self._namespace_exists(router))"},{"line_number":107,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":108,"context_line":"                self.assertTrue(self._metadata_proxy_exists(router))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_22e9efe3","line":105,"in_reply_to":"baada198_fb941242","updated":"2014-08-05 14:42:19.000000000","message":"Point taken - I\u0027ll remove the conditionals and make the configuration explicit.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":108,"context_line":"                self.assertTrue(self._metadata_proxy_exists(router))"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"            # Check that internal \u0026 external devices were created with the"},{"line_number":111,"context_line":"            # expected values"},{"line_number":112,"context_line":"            internal_devices \u003d router.router.get("},{"line_number":113,"context_line":"                l3_constants.INTERFACE_KEY, [])"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_1bdc6617","line":110,"updated":"2014-08-05 06:29:53.000000000","message":"When I see comments like these it seems an obvious place to extract the code it refers to into an appropriately named method - self-documenting method names ftw.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            if self.conf.enable_metadata_proxy:"},{"line_number":108,"context_line":"                self.assertTrue(self._metadata_proxy_exists(router))"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"            # Check that internal \u0026 external devices were created with the"},{"line_number":111,"context_line":"            # expected values"},{"line_number":112,"context_line":"            internal_devices \u003d router.router.get("},{"line_number":113,"context_line":"                l3_constants.INTERFACE_KEY, [])"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_02ecebf3","line":110,"in_reply_to":"baada198_1bdc6617","updated":"2014-08-05 14:42:19.000000000","message":"You\u0027re right.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":105,"name":"Kyle Mestery","email":"mestery@mestery.com","username":"mestery"},"change_message_id":"96cea776c5fd8de0fe4798e523d50eea17d232e8","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                self.assertEqual(existing_gateway, expected_gateway)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"            # Check that SNAT chains exist and aren\u0027t empty"},{"line_number":138,"context_line":"            #TODO(amuller): More robust check than just an empty chain"},{"line_number":139,"context_line":"            if router._snat_enabled and router.ex_gw_port:"},{"line_number":140,"context_line":"                self.assertFalse(router.iptables_manager.is_chain_empty("},{"line_number":141,"context_line":"                    \u0027nat\u0027, \u0027snat\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_ac8194c3","line":138,"updated":"2014-08-04 20:00:56.000000000","message":"Is the plan to address these TODO\u0027s before the code merges?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                self.assertEqual(existing_gateway, expected_gateway)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"            # Check that SNAT chains exist and aren\u0027t empty"},{"line_number":138,"context_line":"            #TODO(amuller): More robust check than just an empty chain"},{"line_number":139,"context_line":"            if router._snat_enabled and router.ex_gw_port:"},{"line_number":140,"context_line":"                self.assertFalse(router.iptables_manager.is_chain_empty("},{"line_number":141,"context_line":"                    \u0027nat\u0027, \u0027snat\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_0215cbe5","line":138,"in_reply_to":"baada198_ac8194c3","updated":"2014-08-05 14:42:19.000000000","message":"No for this one, yes for the floating IP chains existence check. You\u0027re right that this is very unclear... This patch was WIP in progress for a while - I\u0027ll leave only the TODOs that I plan to visit this patch.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"03d131ffc5d6aa15806d5b5b5e7529dd626fce07","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            if router.floating_ips and router.ex_gw_port:"},{"line_number":148,"context_line":"                pass"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        # Assert router has been removed. If the namespace assertion succeeds"},{"line_number":151,"context_line":"        # then the namespace devices and iptable rules have also been deleted,"},{"line_number":152,"context_line":"        # so there\u0027s no need to check that explicitly."},{"line_number":153,"context_line":"        if router.use_namespaces:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_bb4d3ac7","line":150,"updated":"2014-08-05 06:29:53.000000000","message":"\u0027Assert router has been removed.\u0027 \u003c--- This is a good example of an unnecessary comment.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"142a18bc9b74104fc494335047e53db04c3640c6","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            if router.floating_ips and router.ex_gw_port:"},{"line_number":148,"context_line":"                pass"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        # Assert router has been removed. If the namespace assertion succeeds"},{"line_number":151,"context_line":"        # then the namespace devices and iptable rules have also been deleted,"},{"line_number":152,"context_line":"        # so there\u0027s no need to check that explicitly."},{"line_number":153,"context_line":"        if router.use_namespaces:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_e2de173c","line":150,"in_reply_to":"baada198_bb4d3ac7","updated":"2014-08-05 14:42:19.000000000","message":"That\u0027s funny Miguel, I wrote this:\n\"I\u0027ll move these two assertions into a function instead.\"\n\nAs a draft an hour before you added your comment, and the method name I chose is exactly what you suggested.","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"2df80363ae36c495bbc453a43c7ff2e33670320a","unresolved":false,"context_lines":[{"line_number":147,"context_line":"            if router.floating_ips and router.ex_gw_port:"},{"line_number":148,"context_line":"                pass"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"        # Assert router has been removed. If the namespace assertion succeeds"},{"line_number":151,"context_line":"        # then the namespace devices and iptable rules have also been deleted,"},{"line_number":152,"context_line":"        # so there\u0027s no need to check that explicitly."},{"line_number":153,"context_line":"        if router.use_namespaces:"}],"source_content_type":"text/x-python","patch_set":6,"id":"baada198_b8c44e43","line":150,"in_reply_to":"baada198_bb4d3ac7","updated":"2014-08-05 14:21:32.000000000","message":"self._assert_router_doesnt_exist(router)\n\ndef _assert_router_doesnt_exist(self,router): ?","commit_id":"216fe827d5efc543c826c38d2b111011f5c50a9a"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8089e2b8e11109d83feaac85e94e7c3b36815dbc","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":"#"},{"line_number":16,"context_line":"# @author: Assaf Muller, Red Hat."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import contextlib"},{"line_number":19,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_8e1bc46e","line":16,"updated":"2014-08-05 14:53:03.000000000","message":"you do not need the author of the file","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"8089e2b8e11109d83feaac85e94e7c3b36815dbc","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def _assert_floating_ip_chains(self, router):"},{"line_number":140,"context_line":"        if router.floating_ips and router.ex_gw_port:"},{"line_number":141,"context_line":"            #TODO(amuller): Implement"},{"line_number":142,"context_line":"            pass"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def test_router_lifecycle(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_4e7d2c70","line":141,"updated":"2014-08-05 14:53:03.000000000","message":"??","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"262ae2b9a700ad0863e529558d4cb9a5a72bb5a7","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def _assert_floating_ip_chains(self, router):"},{"line_number":140,"context_line":"        if router.floating_ips and router.ex_gw_port:"},{"line_number":141,"context_line":"            #TODO(amuller): Implement"},{"line_number":142,"context_line":"            pass"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def test_router_lifecycle(self):"}],"source_content_type":"text/x-python","patch_set":7,"id":"baada198_8c3c89c2","line":141,"in_reply_to":"baada198_4e7d2c70","updated":"2014-08-06 20:51:20.000000000","message":"Done","commit_id":"d1cc44a62945b996a7ed015e22c28b4238f85263"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"863d0c31fade94921f4797a8c3b77576141ca791","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class L3AgentTestFramework(base.BaseOVSLinuxTestCase):"},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":38,"context_line":"        self.check_sudo_enabled()"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_2f6d369b","line":35,"updated":"2014-08-06 08:21:56.000000000","message":"Could be reasonable to put the L3AgentTestFramework as\nBaseL3AgentTestCase [Linux?] somewere in base?\n\nI\u0027m planing to reuse your class in tests for this:\nhttp://docs-draft.openstack.org/99/105999/9/gate/gate-neutron-specs-docs/8f9a0e3/doc/build/html/specs/juno/agent-child-processes-status.html\n\nSee first work item.\n\nAnd we could want to have separate files for specific l3 agent tests like these\nto avoid this file from growing too much.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"c5e12ec685d1f7300bc02fbc34926401f7bb9aa6","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class L3AgentTestFramework(base.BaseOVSLinuxTestCase):"},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":38,"context_line":"        self.check_sudo_enabled()"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_a55b2588","line":35,"in_reply_to":"baada198_25463523","updated":"2014-08-06 09:29:00.000000000","message":"I mean, I was willing to add a new .py file, with specific tests for the l3_agent\n(we could grow the l3_agent_tests file, but that could eventually explode in LOC)\n\n\n\nfrom neutron.tests.functional.agent import test_l3_agent\n\nclass TestL3AgentChildRespawn(test_l3_agent.L3AgentTestFramework):\n   ...\n\nvs\n\nfrom neutron.tests.functional.agent.linux import base\n\nclass TestL3AgentChildRespawn(base.BaseL3AgentTestCase):\n   ...\n\n\n\nDon\u0027t know, sounds weird to import from a test to build another test.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a7c467fdab8f41a94f929170671fea738f1871b9","unresolved":false,"context_lines":[{"line_number":32,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"class L3AgentTestFramework(base.BaseOVSLinuxTestCase):"},{"line_number":36,"context_line":"    def setUp(self):"},{"line_number":37,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":38,"context_line":"        self.check_sudo_enabled()"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_25463523","line":35,"in_reply_to":"baada198_2f6d369b","updated":"2014-08-06 09:16:59.000000000","message":"What exactly would you like to reuse from this class? What do you want me to split off?","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ffaf5312280c5d970a9913b0feb84eff43afb58c","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        br_int \u003d self.create_ovs_bridge()"},{"line_number":55,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":56,"context_line":"        br_ex \u003d self.create_ovs_bridge()"},{"line_number":57,"context_line":"        self.conf.set_override(\u0027external_network_bridge\u0027, br_ex.br_name)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027, self.conf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_8f5ac21c","line":56,"updated":"2014-08-06 08:17:33.000000000","message":"Shouldn\u0027t we cleanup the bridges on teardown or that\u0027s done by the BaseOVSLinuxTestCase?","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"60ca94990a107f926f56d84d7e51a105dcde8e78","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        br_int \u003d self.create_ovs_bridge()"},{"line_number":55,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":56,"context_line":"        br_ex \u003d self.create_ovs_bridge()"},{"line_number":57,"context_line":"        self.conf.set_override(\u0027external_network_bridge\u0027, br_ex.br_name)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027, self.conf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_e536fd01","line":56,"in_reply_to":"baada198_8588e16c","updated":"2014-08-06 09:36:02.000000000","message":"Nice :)","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a7c467fdab8f41a94f929170671fea738f1871b9","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"        br_int \u003d self.create_ovs_bridge()"},{"line_number":55,"context_line":"        self.conf.set_override(\u0027ovs_integration_bridge\u0027, br_int.br_name)"},{"line_number":56,"context_line":"        br_ex \u003d self.create_ovs_bridge()"},{"line_number":57,"context_line":"        self.conf.set_override(\u0027external_network_bridge\u0027, br_ex.br_name)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027, self.conf)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_8588e16c","line":56,"in_reply_to":"baada198_8f5ac21c","updated":"2014-08-06 09:16:59.000000000","message":"That\u0027s done in the create_ovs_bridge method.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a7c467fdab8f41a94f929170671fea738f1871b9","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        self.arping \u003d mock.patch.object("},{"line_number":63,"context_line":"            self.agent, \u0027_send_gratuitous_arp_packet\u0027).start()"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    @contextlib.contextmanager"},{"line_number":66,"context_line":"    def create_router(self):"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_65b90d16","line":65,"updated":"2014-08-06 09:16:59.000000000","message":"Note to reviewers: I\u0027m going to change this from a context manager to an addCleanup model.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"ffaf5312280c5d970a9913b0feb84eff43afb58c","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            #TODO(amuller): Implement"},{"line_number":142,"context_line":"            pass"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def test_router_lifecycle(self):"},{"line_number":145,"context_line":"        with self.create_router() as router:"},{"line_number":146,"context_line":"            self.assertTrue(self._namespace_exists(router))"},{"line_number":147,"context_line":"            self.assertTrue(self._metadata_proxy_exists(router))"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_4f326af4","line":144,"updated":"2014-08-06 08:17:33.000000000","message":"This is a nit stylistic comment, which is just an opinion, so no -1:\n\nI generally find more readable top-bottom calling functions, because it \nimproves readability, you get the most important functions at top (the caller test_router_lifecycle) and then the least important ones.\n\nBTW, very good job, looking forward to have this ready.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"a7c467fdab8f41a94f929170671fea738f1871b9","unresolved":false,"context_lines":[{"line_number":141,"context_line":"            #TODO(amuller): Implement"},{"line_number":142,"context_line":"            pass"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def test_router_lifecycle(self):"},{"line_number":145,"context_line":"        with self.create_router() as router:"},{"line_number":146,"context_line":"            self.assertTrue(self._namespace_exists(router))"},{"line_number":147,"context_line":"            self.assertTrue(self._metadata_proxy_exists(router))"}],"source_content_type":"text/x-python","patch_set":8,"id":"baada198_85df0166","line":144,"in_reply_to":"baada198_4f326af4","updated":"2014-08-06 09:16:59.000000000","message":"You\u0027ve got a point.","commit_id":"8f9a0de3eae1b0bb66766fadb48016560404ca0d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"e879d11c555a0697abd939096c351d817ca75ae5","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        mock.patch(\u0027neutron.common.rpc.RpcProxy.fanout_cast\u0027).start()"},{"line_number":62,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027, self.conf)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        mock.patch.object(self.agent, \u0027_send_gratuitous_arp_packet\u0027).start()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def manage_router(self):"},{"line_number":67,"context_line":"        router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_ee1e8b5d","line":64,"updated":"2014-08-08 09:17:45.000000000","message":"Why do you need to mock that?, arpping fails?","commit_id":"0058dea37974e755eadc3248fb9830b3e5ca843f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"cc603ef28e19d8f9abc80c5006b34a5dc836ce13","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        mock.patch(\u0027neutron.common.rpc.RpcProxy.fanout_cast\u0027).start()"},{"line_number":62,"context_line":"        self.agent \u003d l3_agent.L3NATAgent(\u0027localhost\u0027, self.conf)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        mock.patch.object(self.agent, \u0027_send_gratuitous_arp_packet\u0027).start()"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    def manage_router(self):"},{"line_number":67,"context_line":"        router \u003d test_l3_agent.prepare_router_data(enable_snat\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":12,"id":"baada198_7f24bc5e","line":64,"in_reply_to":"baada198_ee1e8b5d","updated":"2014-08-10 12:05:22.000000000","message":"I don\u0027t think that I have a very good reason. Just from an isolation point of view I don\u0027t really want to explicitly generate traffic out of the VM. Maybe I can mock it a level lower.","commit_id":"0058dea37974e755eadc3248fb9830b3e5ca843f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ee6c5578fd288fc868097b3b2b91916ca4c3d60f","unresolved":false,"context_lines":[{"line_number":30,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class L3AgentTestFramework(base.BaseOVSLinuxTestCase):"},{"line_number":34,"context_line":"    def setUp(self):"},{"line_number":35,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":36,"context_line":"        self.check_sudo_enabled()"}],"source_content_type":"text/x-python","patch_set":23,"id":"7ac7a964_bbd87d80","line":33,"updated":"2014-08-15 16:12:47.000000000","message":"Hey, after seeing the comments on the dependent patch, I wonder if this is correct or if \"OVS\" should be left out.","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1655368e0e03d537245055bdc5e393f83aec3821","unresolved":false,"context_lines":[{"line_number":30,"context_line":"_uuid \u003d uuidutils.generate_uuid"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class L3AgentTestFramework(base.BaseOVSLinuxTestCase):"},{"line_number":34,"context_line":"    def setUp(self):"},{"line_number":35,"context_line":"        super(L3AgentTestFramework, self).setUp()"},{"line_number":36,"context_line":"        self.check_sudo_enabled()"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_70bac9c1","line":33,"in_reply_to":"7ac7a964_bbd87d80","updated":"2014-08-25 08:51:59.000000000","message":"I\u0027m using create_ovs_bridge from BaseOVSLinuxTestCase in lines 53 and 55.","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ee6c5578fd288fc868097b3b2b91916ca4c3d60f","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def _metadata_proxy_exists(self, router_id, ns_name):"},{"line_number":91,"context_line":"        pm \u003d external_process.ProcessManager("},{"line_number":92,"context_line":"            self.conf,"},{"line_number":93,"context_line":"            router_id,"},{"line_number":94,"context_line":"            self.root_helper,"},{"line_number":95,"context_line":"            ns_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7ac7a964_1b38919f","line":92,"updated":"2014-08-15 16:12:47.000000000","message":"nit:  Seeing this gives me a hint at why you set self.conf in the dependent patch.  ;)\n\ncfg.CONF is globally available so is it necessary?","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"1655368e0e03d537245055bdc5e393f83aec3821","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"    def _metadata_proxy_exists(self, router_id, ns_name):"},{"line_number":91,"context_line":"        pm \u003d external_process.ProcessManager("},{"line_number":92,"context_line":"            self.conf,"},{"line_number":93,"context_line":"            router_id,"},{"line_number":94,"context_line":"            self.root_helper,"},{"line_number":95,"context_line":"            ns_name)"}],"source_content_type":"text/x-python","patch_set":23,"id":"1abeadc6_b0b461d2","line":92,"in_reply_to":"7ac7a964_1b38919f","updated":"2014-08-25 08:51:59.000000000","message":"Not really. If it bothers you I\u0027m happy to remove it :)","commit_id":"3706a4c6ca186b57da6424fcb64b3f4a32701a1f"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7ddaa69fcbf2a73cbd27569d3f6b5eaf8d07b69d","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            \u0027interface_driver\u0027,"},{"line_number":45,"context_line":"            \u0027neutron.agent.linux.interface.OVSInterfaceDriver\u0027)"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027router_delete_namespaces\u0027, True)"},{"line_number":47,"context_line":"        cfg.CONF.set_override(\u0027lock_path\u0027, \u0027$state_path/lock\u0027)"},{"line_number":48,"context_line":"        cfg.CONF.set_override(\u0027root_helper\u0027, self.root_helper, group\u003d\u0027AGENT\u0027)"},{"line_number":49,"context_line":"        cfg.CONF.set_override(\u0027use_namespaces\u0027, True)"},{"line_number":50,"context_line":"        cfg.CONF.set_override(\u0027enable_metadata_proxy\u0027, True)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_14549bfd","line":47,"updated":"2014-08-28 09:41:03.000000000","message":"This line is unnecessary for the dsvm-functional tox env since the following change merged:\n\nhttps://review.openstack.org/#/c/101424/\n\nThe functional tox env change is still pending: \n\nhttps://review.openstack.org/#/c/117460/","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fdd777c2293e1edfbd6729a56a886fb533f1570b","unresolved":false,"context_lines":[{"line_number":44,"context_line":"            \u0027interface_driver\u0027,"},{"line_number":45,"context_line":"            \u0027neutron.agent.linux.interface.OVSInterfaceDriver\u0027)"},{"line_number":46,"context_line":"        cfg.CONF.set_override(\u0027router_delete_namespaces\u0027, True)"},{"line_number":47,"context_line":"        cfg.CONF.set_override(\u0027lock_path\u0027, \u0027$state_path/lock\u0027)"},{"line_number":48,"context_line":"        cfg.CONF.set_override(\u0027root_helper\u0027, self.root_helper, group\u003d\u0027AGENT\u0027)"},{"line_number":49,"context_line":"        cfg.CONF.set_override(\u0027use_namespaces\u0027, True)"},{"line_number":50,"context_line":"        cfg.CONF.set_override(\u0027enable_metadata_proxy\u0027, True)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_0351bf35","line":47,"in_reply_to":"1abeadc6_14549bfd","updated":"2014-08-28 17:45:05.000000000","message":"Locally, the \u0027functional\u0027 tox venv skips all tests. I\u0027ll remove the lock_path override, dsvm-functional works fine locally without it.","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7ddaa69fcbf2a73cbd27569d3f6b5eaf8d07b69d","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        self.assertTrue(self._namespace_exists(router))"},{"line_number":111,"context_line":"        self.assertTrue(self._metadata_proxy_exists(router))"},{"line_number":112,"context_line":"        self._assert_internal_devices(router)"},{"line_number":113,"context_line":"        self._assert_external_device(router)"},{"line_number":114,"context_line":"        self._assert_gateway(router)"},{"line_number":115,"context_line":"        self._assert_snat_chains(router)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_14a81b8c","line":112,"updated":"2014-08-28 09:41:03.000000000","message":"All the assertion methods here use unqualified conditionals which is a bad idea in a test.  I\u0027d like to see either the conditionals removed or each assertion method take a boolean for each conditional that would fail the test when the conditional did not pass, e.g.\n\ndef _assert_external_device(self, router, required\u003dTrue):\n  external_port \u003d ...\n  if external_port:\n    ...\n  elif required:\n    self.fail()","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fdd777c2293e1edfbd6729a56a886fb533f1570b","unresolved":false,"context_lines":[{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        self.assertTrue(self._namespace_exists(router))"},{"line_number":111,"context_line":"        self.assertTrue(self._metadata_proxy_exists(router))"},{"line_number":112,"context_line":"        self._assert_internal_devices(router)"},{"line_number":113,"context_line":"        self._assert_external_device(router)"},{"line_number":114,"context_line":"        self._assert_gateway(router)"},{"line_number":115,"context_line":"        self._assert_snat_chains(router)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_1a0670ce","line":112,"in_reply_to":"1abeadc6_14a81b8c","updated":"2014-08-28 17:45:05.000000000","message":"Done","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7ddaa69fcbf2a73cbd27569d3f6b5eaf8d07b69d","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        self._assert_router_does_not_exist(router)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _assert_internal_devices(self, router):"},{"line_number":122,"context_line":"        internal_devices \u003d router.router.get("},{"line_number":123,"context_line":"            l3_constants.INTERFACE_KEY, [])"},{"line_number":124,"context_line":"        for device in internal_devices:"},{"line_number":125,"context_line":"            self.assertTrue(self.device_exists_with_ip_mac("}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_f4839f53","line":122,"updated":"2014-08-28 09:41:03.000000000","message":"(No action required) Not sure why this line is split.\n\nAlso, if internal devices are expected (i.e. required\u003dTrue), I would expect an assertion to validate this.","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fdd777c2293e1edfbd6729a56a886fb533f1570b","unresolved":false,"context_lines":[{"line_number":119,"context_line":"        self._assert_router_does_not_exist(router)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _assert_internal_devices(self, router):"},{"line_number":122,"context_line":"        internal_devices \u003d router.router.get("},{"line_number":123,"context_line":"            l3_constants.INTERFACE_KEY, [])"},{"line_number":124,"context_line":"        for device in internal_devices:"},{"line_number":125,"context_line":"            self.assertTrue(self.device_exists_with_ip_mac("}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_272de646","line":122,"in_reply_to":"1abeadc6_f4839f53","updated":"2014-08-28 17:45:05.000000000","message":"Un-split the line.","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":2035,"name":"Maru Newby","email":"marun@redhat.com","username":"maru"},"change_message_id":"7ddaa69fcbf2a73cbd27569d3f6b5eaf8d07b69d","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            external_device \u003d ip_lib.IPDevice(external_device_name,"},{"line_number":141,"context_line":"                                              self.root_helper,"},{"line_number":142,"context_line":"                                              router.ns_name)"},{"line_number":143,"context_line":"            existing_gateway \u003d (external_device.route.get_gateway()."},{"line_number":144,"context_line":"                                get(\u0027gateway\u0027))"},{"line_number":145,"context_line":"            expected_gateway \u003d external_port[\u0027subnet\u0027][\u0027gateway_ip\u0027]"},{"line_number":146,"context_line":"            self.assertEqual(existing_gateway, expected_gateway)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_d4b86313","line":143,"updated":"2014-08-28 09:41:03.000000000","message":"(No action required) Thought it\u0027s a common enough practice around sqlalchemy usage, I would prefer not to see splits on \u0027.\u0027, e.g. I would prefer this:\n\nexisting_gateway \u003d (\n  external_device...  )","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"fdd777c2293e1edfbd6729a56a886fb533f1570b","unresolved":false,"context_lines":[{"line_number":140,"context_line":"            external_device \u003d ip_lib.IPDevice(external_device_name,"},{"line_number":141,"context_line":"                                              self.root_helper,"},{"line_number":142,"context_line":"                                              router.ns_name)"},{"line_number":143,"context_line":"            existing_gateway \u003d (external_device.route.get_gateway()."},{"line_number":144,"context_line":"                                get(\u0027gateway\u0027))"},{"line_number":145,"context_line":"            expected_gateway \u003d external_port[\u0027subnet\u0027][\u0027gateway_ip\u0027]"},{"line_number":146,"context_line":"            self.assertEqual(existing_gateway, expected_gateway)"}],"source_content_type":"text/x-python","patch_set":26,"id":"1abeadc6_c71d1211","line":143,"in_reply_to":"1abeadc6_d4b86313","updated":"2014-08-28 17:45:05.000000000","message":"Done","commit_id":"823470fad4d5bc60dcbd0d429eac882c34e2f9ac"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"20341d987f5b6b6615adf979f227c6c7688e473b","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            self.agent._router_removed(router_id)"},{"line_number":80,"context_line":"        except RuntimeError:"},{"line_number":81,"context_line":"            LOG.debug(\u0027Deletion of router %s failed. Was it already deleted?\u0027,"},{"line_number":82,"context_line":"                      router_id)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _namespace_exists(self, router):"},{"line_number":85,"context_line":"        ip \u003d ip_lib.IPWrapper(self.root_helper, router.ns_name)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_bfb8e0c8","line":82,"updated":"2014-08-29 13:20:41.000000000","message":"can we ignore RuntimeError in this case? If so, it is better to add some comments so that we can know the reason in the future.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"6ef088aa5c52eff117af9eda7bb66f7d929ea714","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            self.agent._router_removed(router_id)"},{"line_number":80,"context_line":"        except RuntimeError:"},{"line_number":81,"context_line":"            LOG.debug(\u0027Deletion of router %s failed. Was it already deleted?\u0027,"},{"line_number":82,"context_line":"                      router_id)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _namespace_exists(self, router):"},{"line_number":85,"context_line":"        ip \u003d ip_lib.IPWrapper(self.root_helper, router.ns_name)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_8f0a11d0","line":82,"in_reply_to":"1abeadc6_50ac1bed","updated":"2014-08-29 15:12:15.000000000","message":"Thanks for the clarification. Makes sense to me.\n\nFrom my experience on Ubuntu 12.04, linux kernel sometimes fails to delete netns even when no process uses the netns. Isaku investigated the detail in the bug report a year ago (If needed I will search the bug report). If it causes test failures, let\u0027s use try/except again in the future. At first I thought you experienced the above.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8e70628796d98f8f96126c4addfde74747164e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            self.agent._router_removed(router_id)"},{"line_number":80,"context_line":"        except RuntimeError:"},{"line_number":81,"context_line":"            LOG.debug(\u0027Deletion of router %s failed. Was it already deleted?\u0027,"},{"line_number":82,"context_line":"                      router_id)"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"    def _namespace_exists(self, router):"},{"line_number":85,"context_line":"        ip \u003d ip_lib.IPWrapper(self.root_helper, router.ns_name)"}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_50ac1bed","line":82,"in_reply_to":"1abeadc6_bfb8e0c8","updated":"2014-08-29 14:29:26.000000000","message":"_delete_router is used twice - Once during the test and once as a clean up. Looking back at this I think not re-raising the exception could mask the real failure (And even give a misleading log message).\n\nIf a router was already deleted, the L3 agent doesn\u0027t throw an exception, it just does nothing. If the router wasn\u0027t already deleted and we get a RuntimeError it\u0027s because something bad happens and we\u0027d want the stack trace (And to fail the test) if it was during the test. During clean up if the explicit delete succeeded then there\u0027s no reason why the 2nd deletion would fail. If the first one failed then the second one will fail as well, probably with the same trace.\n\nTo summarize I\u0027ll remove the try/except. It can only make things worse.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"}],"neutron/tests/unit/test_l3_agent.py":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"20341d987f5b6b6615adf979f227c6c7688e473b","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    floating_ips \u003d [{"},{"line_number":262,"context_line":"        \u0027id\u0027: _uuid(), \u0027port_id\u0027: _uuid(),"},{"line_number":263,"context_line":"        \u0027floating_ip_address\u0027: \u002719.4.4.2\u0027,"},{"line_number":264,"context_line":"        \u0027fixed_ip_address\u0027: \u002710.0.0.1\u0027}]"},{"line_number":265,"context_line":"    if enable_floating_ip:"},{"line_number":266,"context_line":"        router[l3_constants.FLOATINGIP_KEY] \u003d floating_ips"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_1ff554ec","line":264,"updated":"2014-08-29 13:20:41.000000000","message":"It is better to move L.261-264 inside if-clause below. floating_ips is used only if enable_floating_ip is True.","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"5e8e70628796d98f8f96126c4addfde74747164e","unresolved":false,"context_lines":[{"line_number":261,"context_line":"    floating_ips \u003d [{"},{"line_number":262,"context_line":"        \u0027id\u0027: _uuid(), \u0027port_id\u0027: _uuid(),"},{"line_number":263,"context_line":"        \u0027floating_ip_address\u0027: \u002719.4.4.2\u0027,"},{"line_number":264,"context_line":"        \u0027fixed_ip_address\u0027: \u002710.0.0.1\u0027}]"},{"line_number":265,"context_line":"    if enable_floating_ip:"},{"line_number":266,"context_line":"        router[l3_constants.FLOATINGIP_KEY] \u003d floating_ips"},{"line_number":267,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"1abeadc6_55ffad33","line":264,"in_reply_to":"1abeadc6_1ff554ec","updated":"2014-08-29 14:29:26.000000000","message":"Done","commit_id":"6ea717701f9971484e4aea75ccbc9266cbed0775"}]}
