)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"79e783ab08e6c7a9f4a9fb54725ae4a4ee1ab18b","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Research of various Linux operating systems has indicated that"},{"line_number":16,"context_line":"namespaces are represented as files in /var/run/netns AND root"},{"line_number":17,"context_line":"authority is not required in order to look at the files in this"},{"line_number":18,"context_line":"subdirectory."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Rather than swapping to root and gathering a list of all namespaces,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a1a9d01_6adeac12","line":17,"updated":"2015-09-28 19:25:59.000000000","message":"It seems incorrect according to https://review.openstack.org/109736","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"ddc9cca39a0cca7b0aab671c26112d2400ebcc81","unresolved":false,"context_lines":[{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Research of various Linux operating systems has indicated that"},{"line_number":16,"context_line":"namespaces are represented as files in /var/run/netns AND root"},{"line_number":17,"context_line":"authority is not required in order to look at the files in this"},{"line_number":18,"context_line":"subdirectory."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Rather than swapping to root and gathering a list of all namespaces,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a1a9d01_a5ae3783","line":17,"in_reply_to":"9a1a9d01_6adeac12","updated":"2015-09-28 19:51:04.000000000","message":"That original bug/patch added this config option and sudo check due to a Centos 6.5 issue.  \n\nI think the correct fix would be to fail to start the L3 / DHCP agent if this scenario is detected rather than hurt the performance of all other distros.","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"64311877d03de39b8fd3f067a6a0b17c06a06e82","unresolved":false,"context_lines":[{"line_number":15,"context_line":"Research of various Linux operating systems has indicated that"},{"line_number":16,"context_line":"namespaces are represented as files in /var/run/netns AND root"},{"line_number":17,"context_line":"authority is not required in order to look at the files in this"},{"line_number":18,"context_line":"subdirectory."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Rather than swapping to root and gathering a list of all namespaces,"},{"line_number":21,"context_line":"it is more efficient to just check for the namespace file object"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a1a9d01_d1518d37","line":18,"updated":"2015-09-29 13:10:33.000000000","message":"This is incorrect. These are regular file permissions and a deployment may choose to restrict who can list the namespaces. It\u0027s not something guaranteed to work just because it\u0027s an operating system default.","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"a41db3af435cc2573bdd5d1db40d1ec5a277fcb7","unresolved":false,"context_lines":[{"line_number":15,"context_line":"Research of various Linux operating systems has indicated that"},{"line_number":16,"context_line":"namespaces are represented as files in /var/run/netns AND root"},{"line_number":17,"context_line":"authority is not required in order to look at the files in this"},{"line_number":18,"context_line":"subdirectory."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Rather than swapping to root and gathering a list of all namespaces,"},{"line_number":21,"context_line":"it is more efficient to just check for the namespace file object"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"9a1a9d01_a474c267","line":18,"in_reply_to":"9a1a9d01_d1518d37","updated":"2015-09-29 21:11:42.000000000","message":"I will take this into account in the next patch set, try/catch around new logic with the old logic in the else leg.","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"98a216601de898c855b7416535e85ec3464fefc9","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                             extra_ok_codes\u003dextra_ok_codes, **kwargs)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def exists(self, name):"},{"line_number":820,"context_line":"        return os.path.exists(IP_NETNS_PATH + name)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_74e8fce2","line":820,"updated":"2015-09-27 07:11:43.000000000","message":"are we 100% sure that this is supported by all distros. if so then this is really nice","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"fd8d46694b5eadcd9f74788cfdde100a783277c4","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                             extra_ok_codes\u003dextra_ok_codes, **kwargs)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def exists(self, name):"},{"line_number":820,"context_line":"        return os.path.exists(IP_NETNS_PATH + name)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_d7a8eadd","line":820,"in_reply_to":"9a1a9d01_74e8fce2","updated":"2015-09-27 08:45:37.000000000","message":"I think the ip netns is doing this definitely: http://man7.org/linux/man-pages/man8/ip-netns.8.html","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"a95c377cd6e6a6c991d676d1d3114c9f5cd3f11b","unresolved":false,"context_lines":[{"line_number":817,"context_line":"                             extra_ok_codes\u003dextra_ok_codes, **kwargs)"},{"line_number":818,"context_line":""},{"line_number":819,"context_line":"    def exists(self, name):"},{"line_number":820,"context_line":"        return os.path.exists(IP_NETNS_PATH + name)"},{"line_number":821,"context_line":""},{"line_number":822,"context_line":""},{"line_number":823,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_e90418c1","line":820,"in_reply_to":"9a1a9d01_d7a8eadd","updated":"2015-09-28 14:44:16.000000000","message":"The above check works for all of the distros that I\u0027ve looked at","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"bef00d8443b23896e95a16080017898f46d15a7f","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        return (IPDevice(name, namespace\u003dself.namespace))"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        output \u003d cls._execute([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":212,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":213,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_27f6b4d7","line":210,"updated":"2015-09-28 16:52:29.000000000","message":"\u0027cfg.CONF.AGENT.use_helper_for_ns_read\u0027  is not used here.\n\nIs that config option still needed ?","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"17b00b9331a4decde142ceb9fb2fdc5c9d86af68","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        output \u003d cls._execute([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":212,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_0a3e10b8","line":211,"updated":"2015-09-28 19:15:59.000000000","message":"I think you have found another possible optimization - os.listdir(IP_NETNS_PATH) would work nicely here","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"ddc9cca39a0cca7b0aab671c26112d2400ebcc81","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        output \u003d cls._execute([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":212,"context_line":"        return [l.strip() for l in output.split(\u0027\\n\u0027)]"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_e5e8afe4","line":211,"in_reply_to":"9a1a9d01_0a3e10b8","updated":"2015-09-28 19:51:04.000000000","message":"Is \"root\" is really needed on Centos 6.5 or other platforms that have /var/run/netns locked down, then the above \"ip netns\"  request will never work on those platforms and this routine has always been broken.","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"fc7b02dc57aeea578fe3fc1295dbbe3eb6866115","unresolved":false,"context_lines":[{"line_number":819,"context_line":"                             extra_ok_codes\u003dextra_ok_codes, **kwargs)"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def exists(self, name):"},{"line_number":822,"context_line":"        return os.path.exists(IP_NETNS_PATH + name)"},{"line_number":823,"context_line":""},{"line_number":824,"context_line":""},{"line_number":825,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_dbfb03c0","line":822,"updated":"2015-09-28 23:04:23.000000000","message":"we can fall back if os.path.exists return permission error to cfg.CONF.AGENT.use_helper_for_ns_read way","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"0924abc847ceb5ae3b7e300e43175c89b96cf8e9","unresolved":false,"context_lines":[{"line_number":819,"context_line":"                             extra_ok_codes\u003dextra_ok_codes, **kwargs)"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def exists(self, name):"},{"line_number":822,"context_line":"        return os.path.exists(IP_NETNS_PATH + name)"},{"line_number":823,"context_line":""},{"line_number":824,"context_line":""},{"line_number":825,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_7b80b7c0","line":822,"in_reply_to":"9a1a9d01_dbfb03c0","updated":"2015-09-28 23:18:41.000000000","message":"Perhaps that could be done here, but seems like additional logic will also need to be added to L211 to start using cfg.CONF.AGENT.use_helper_for_ns_read.   I am a little confused as to why L211 never had that logic in the first place....  and no one complained. Is the root check really needed ?","commit_id":"729533a09c4b7913769d103c9d44291b8e410589"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4309c48c5a32ae71ec5331877e22d42ea4928e0c","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"},{"line_number":214,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":215,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_4b9b4918","line":212,"updated":"2015-09-30 17:49:55.000000000","message":"It seems there is no reason to try the first method if cfg.CONF.AGENT.use_helper_for_ns_read \u003d\u003d True:\n\n if cfg.CONF.AGENT.use_helper_for_ns_read:\n   output \u003d cls._execute(...)\n   return [...]\n return os.listdir(IP_NETNS_PATH)","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"b8f8f7cc0807c88937f69273339d8b0401061668","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"},{"line_number":214,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":215,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_8e664fb9","line":212,"in_reply_to":"9a1a9d01_4b9b4918","updated":"2015-09-30 18:01:25.000000000","message":"The performance of the Python native os.listdir() is much faster and that is why it is being added here.  The try/except only occurs in the rare cases in which /var/run/netns has been locked down from regular users.   The old logic is broken because it does not swap to root, hence it does not handle the locked down permission case at all.  It returns with no namespaces.","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"c2f0a0b0415d38cbe1f23f9358f7c03f0e8ef4c8","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"},{"line_number":214,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":215,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_1ad355d6","line":212,"in_reply_to":"9a1a9d01_711cfc69","updated":"2015-09-30 19:41:46.000000000","message":"Correct, os.listdir is not faster than doing nothing.\n\nHowever, if os.listdir can be done 99% of the time and it is 95% faster than the current logic, it seems like it is worth it to me.  The rare cases in which os.listdir can\u0027t be used, the additional overhead of catching the \"OSError - access is denied\" exception would still be minimal compared to the cost it takes to run through the old code path.","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"9e952ac076b6969c8ba406a10d852ad4157f7844","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"},{"line_number":214,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":215,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_d4113653","line":212,"in_reply_to":"9a1a9d01_711cfc69","updated":"2015-09-30 18:32:56.000000000","message":"Yes, that referenced patch did not change this get_namespaces call so the original bug was only partially fixed.","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"f740cdd3054ae5bbe8c3aca762043bdc8acdf132","unresolved":false,"context_lines":[{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"},{"line_number":214,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":215,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_711cfc69","line":212,"in_reply_to":"9a1a9d01_8e664fb9","updated":"2015-09-30 18:16:48.000000000","message":"os.listdir is fast but not faster than doing nothing. Indeed previous change[1] defined cfg.CONF.AGENT.use_helper_for_ns_read option in order to handle the case where /var/run/netns access is constrained[1].\n\n[1] https://review.openstack.org/109736","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"4309c48c5a32ae71ec5331877e22d42ea4928e0c","unresolved":false,"context_lines":[{"line_number":829,"context_line":"            output \u003d self._parent._execute("},{"line_number":830,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":831,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"},{"line_number":832,"context_line":"        return (name in output)"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_ab8c65da","line":832,"updated":"2015-09-30 17:49:55.000000000","message":"useless braces","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"b8f8f7cc0807c88937f69273339d8b0401061668","unresolved":false,"context_lines":[{"line_number":829,"context_line":"            output \u003d self._parent._execute("},{"line_number":830,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027],"},{"line_number":831,"context_line":"                run_as_root\u003dcfg.CONF.AGENT.use_helper_for_ns_read)"},{"line_number":832,"context_line":"        return (name in output)"},{"line_number":833,"context_line":""},{"line_number":834,"context_line":""},{"line_number":835,"context_line":"def vxlan_in_use(segmentation_id, namespace\u003dNone):"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_ce1e870b","line":832,"in_reply_to":"9a1a9d01_ab8c65da","updated":"2015-09-30 18:01:25.000000000","message":"Will switch to following if respin is needed:\n\n   return name in output","commit_id":"7092ee91d0c4b9397296ae068bce64a5046558e5"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"d44e766f864c257d6b6dcfc62355e1931edb8f4a","unresolved":false,"context_lines":[{"line_number":207,"context_line":"        return (IPDevice(name, namespace\u003dself.namespace))"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    @classmethod"},{"line_number":210,"context_line":"    def get_namespaces(cls):"},{"line_number":211,"context_line":"        try:"},{"line_number":212,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":213,"context_line":"        except OSError:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_a08d5cd4","line":210,"updated":"2015-09-30 20:34:49.000000000","message":"Request from PS 6... to remove try/catch and change logic to be:\n\n if cfg.CONF.AGENT.use_helper_for_ns_read:\n   output \u003d cls._execute(...)\n   return [...]\n return os.listdir(IP_NETNS_PATH)\n\nThat change will be made in next patch set.","commit_id":"33507f9389827ffecc2122af43f96019dc26af79"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"bd87c6162fd914250ce7036a2904dae033339cdf","unresolved":false,"context_lines":[{"line_number":790,"context_line":"        \"\"\""},{"line_number":791,"context_line":"        self._as_root([ip_version], (\u0027flush\u0027, \u0027to\u0027, ip_address))"},{"line_number":792,"context_line":""},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"class IpNetnsCommand(IpCommandBase):"},{"line_number":795,"context_line":"    COMMAND \u003d \u0027netns\u0027"},{"line_number":796,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_196fa793","line":793,"updated":"2015-10-02 01:32:17.000000000","message":"The exists() method below is part of this class.  Bridge names are never passed into the \"exists()\" method for this class.","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6aeef33ff46fb60bcdfddde8b625e07b0bb1b373","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_0b59968e","line":825,"updated":"2015-10-01 21:41:37.000000000","message":"output is a string so the method will return true if name is found in one of the bridge names: \u0027br\u0027 in \u0027brtest\u0027 \u003d\u003d True! \u003d\u003d\u003e KO","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"bd87c6162fd914250ce7036a2904dae033339cdf","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_795d83eb","line":825,"in_reply_to":"9a1a9d01_0b59968e","updated":"2015-10-02 01:32:17.000000000","message":"The \"name\" is never a bridge name.  This exists() method is in the class  IpNetnsCommand.  The only namespaces that are used are \"qrouter-\u003crouter id\u003e\"  and \"qdhcp--\u003cnetwork id\u003e\".","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"7e0a9744d2cf5495ca582a2d100b4eb38dbec18a","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_997165e3","line":825,"in_reply_to":"9a1a9d01_1948f55a","updated":"2015-10-02 12:49:45.000000000","message":"Yeah, you\u0027re right.  Code looks cleaner this way?   :-)    Ok, I\u0027ll re-add the for loop back in.\n\nSide topic:  Never realized how much slower a for loop was as compared to \"name in string\" until this bug/patch when I measured the diff.","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"bef275ed6f6dfa10c5549863fee8d07b79285ed3","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_ce9ab5c5","line":825,"in_reply_to":"9a1a9d01_70cfcdb3","updated":"2015-10-02 12:04:00.000000000","message":"With the current way in which we name the namespaces, qrouter/qdhcp- \u003cuuid\u003e ... I don\u0027t see how the \"return name in output\" logic on a string could ever NOT perform an exact match.   Are you concerned about the case in which the admin is going to go out and create additional namespaces called  qrouter-\u003cuuid\u003e-dummy ...   that we would also match on?   Even if the admin wanted to do this, the target uuid would first have to be obtained, hence the network/router would already have to be generated. \n\nIf UUIDs get changed in the future to instead be simple integers {1, 2, 3, 4.....}, then yes there would be issues in that case due to the resulting namespace strings being varying in length.   qrouter-1 lookup would match on a qrouter-10.  Are uuids ever implemented as integers on any distro ?","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"2dfced0a4ef7a72b197c151344a54fec9d738330","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_70cfcdb3","line":825,"in_reply_to":"9a1a9d01_795d83eb","updated":"2015-10-02 09:14:17.000000000","message":"Ok, namespace name not bridge name but that\u0027s still not acceptable as it doesn\u0027t perform an exact match","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"04b4ecb8c253ad77f3096c1e6a6e64d3926469e1","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_147e7cae","line":825,"in_reply_to":"9a1a9d01_997165e3","updated":"2015-10-02 13:11:28.000000000","message":"Done","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"b2cf5b576a433ca5a6539de014de89fb6b6f8426","unresolved":false,"context_lines":[{"line_number":822,"context_line":""},{"line_number":823,"context_line":"    def exists(self, name):"},{"line_number":824,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_1948f55a","line":825,"in_reply_to":"9a1a9d01_ce9ab5c5","updated":"2015-10-02 12:28:54.000000000","message":"The aim of \"exists\" is to return True if the namespace exists (without assuming how the method will be used)","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6aeef33ff46fb60bcdfddde8b625e07b0bb1b373","unresolved":false,"context_lines":[{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"},{"line_number":829,"context_line":"        return name in output"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_6bf29271","line":828,"updated":"2015-10-01 21:41:37.000000000","message":"output is a list so the method returns true if a bridge has name as name \u003d\u003d\u003e OK","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"bd87c6162fd914250ce7036a2904dae033339cdf","unresolved":false,"context_lines":[{"line_number":825,"context_line":"            output \u003d self._parent._execute("},{"line_number":826,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":827,"context_line":"        else:"},{"line_number":828,"context_line":"            output \u003d os.listdir(IP_NETNS_PATH)"},{"line_number":829,"context_line":"        return name in output"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a1a9d01_d9684f8a","line":828,"in_reply_to":"9a1a9d01_6bf29271","updated":"2015-10-02 01:32:17.000000000","message":"Bridge names are never passed into this method.","commit_id":"9472c18035ea23e1e65697c56b19a08680f132e2"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fc044445f72ddc0bfeda80d56147d5e7ba4d2e41","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":215,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":216,"context_line":"            return [l.split()[0] for l in output.splitlines()]"},{"line_number":217,"context_line":"        return os.listdir(IP_NETNS_PATH)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"class IPDevice(SubProcessBase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_a20c2843","line":217,"updated":"2015-10-02 20:56:30.000000000","message":"nit:  Less code churn...\n\n  if not cfg.CONF.AGENT.use_helper_for_ns_read:\n      return os.listdir(IP_NETNS_PATH)\n\n  output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)\n  return [l.split()[0] for l in output.splitlines()]","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"fc93888d68d83445e482db1f2ee2094affafd712","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":215,"context_line":"            output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":216,"context_line":"            return [l.split()[0] for l in output.splitlines()]"},{"line_number":217,"context_line":"        return os.listdir(IP_NETNS_PATH)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"class IPDevice(SubProcessBase):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_61292589","line":217,"in_reply_to":"9a1a9d01_a20c2843","updated":"2015-10-02 21:17:51.000000000","message":"Good suggestion.  Done.","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"41f1b21f587baa3018b9e94e4c4b50d7fc671c6d","unresolved":false,"context_lines":[{"line_number":843,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":844,"context_line":"            output \u003d self._parent._execute("},{"line_number":845,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":846,"context_line":"            for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":847,"context_line":"                if name \u003d\u003d line:"},{"line_number":848,"context_line":"                    return True"},{"line_number":849,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_1fe45539","line":846,"updated":"2015-10-02 13:16:37.000000000","message":"you can be lazy by doing:\n\n return any(name \u003d\u003d l.split()[0] for l in output.splitlines())","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"195268eb9a442787c29fb3a84d8a78e0d5e25675","unresolved":false,"context_lines":[{"line_number":843,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":844,"context_line":"            output \u003d self._parent._execute("},{"line_number":845,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":846,"context_line":"            for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":847,"context_line":"                if name \u003d\u003d line:"},{"line_number":848,"context_line":"                    return True"},{"line_number":849,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_2e3a4cce","line":846,"in_reply_to":"9a1a9d01_1fe45539","updated":"2015-10-02 13:52:25.000000000","message":"My python knowledge is not as good as yours.  I need to go look up exactly what your changed line is doing.  I went back to the original logic (prior to this patch).  I figured that the fewer changes to the existing code path, the better.","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fc044445f72ddc0bfeda80d56147d5e7ba4d2e41","unresolved":false,"context_lines":[{"line_number":843,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":844,"context_line":"            output \u003d self._parent._execute("},{"line_number":845,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":846,"context_line":"            for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":847,"context_line":"                if name \u003d\u003d line:"},{"line_number":848,"context_line":"                    return True"},{"line_number":849,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_82724410","line":846,"in_reply_to":"9a1a9d01_2e3a4cce","updated":"2015-10-02 20:56:30.000000000","message":"+1 to keeping the original logic untouched.  @Cedric\u0027s suggested alternative is compact, readable, and pythonic but I tend to place not disturbing existing code over that in most cases, especially when it has nothing to do with the goal of the current patch set.\n\nI do have a different suggestion.  If you write this change this way, you can avoid changing even the indentation.  That helps reviewers by making the change smaller and also could help avoid merge conflicts in general when done this way.\n\n  if not cfg.CONF.AGENT.use_helper_for_ns_read:\n      return name in os.listdir(IP_NETNS_PATH)\n\n  output \u003d self._parent._execute(\n      [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027],\n      run_as_root\u003dTrue)\n  ... the rest of the method at the original indention level.","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"fc93888d68d83445e482db1f2ee2094affafd712","unresolved":false,"context_lines":[{"line_number":843,"context_line":"        if cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":844,"context_line":"            output \u003d self._parent._execute("},{"line_number":845,"context_line":"                [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":846,"context_line":"            for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":847,"context_line":"                if name \u003d\u003d line:"},{"line_number":848,"context_line":"                    return True"},{"line_number":849,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_e10e9531","line":846,"in_reply_to":"9a1a9d01_82724410","updated":"2015-10-02 21:17:51.000000000","message":"Good suggestion.  Done.","commit_id":"ad30a6f02972db2f236e66695631b4b28d3c4ea4"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"0ce1c80e33680324152d9a31211d09f90910af62","unresolved":false,"context_lines":[{"line_number":841,"context_line":"            return name in os.listdir(IP_NETNS_PATH)"},{"line_number":842,"context_line":""},{"line_number":843,"context_line":"        output \u003d self._parent._execute("},{"line_number":844,"context_line":"            [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":845,"context_line":"        for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":846,"context_line":"            if name \u003d\u003d line:"},{"line_number":847,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a1a9d01_0144e971","line":844,"updated":"2015-10-02 21:50:56.000000000","message":"This can be like delete() above, since it must be run as root now:\n\noutput \u003d self._as_root([o], (\u0027list\u0027), use_root_namespace\u003dTrue)","commit_id":"5e497093b8388234aabab5691e1f416d12fde360"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"b17cfd6cd0692fc1109c9db384de3805ff6829b6","unresolved":false,"context_lines":[{"line_number":841,"context_line":"            return name in os.listdir(IP_NETNS_PATH)"},{"line_number":842,"context_line":""},{"line_number":843,"context_line":"        output \u003d self._parent._execute("},{"line_number":844,"context_line":"            [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":845,"context_line":"        for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":846,"context_line":"            if name \u003d\u003d line:"},{"line_number":847,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":11,"id":"9a1a9d01_13cf3680","line":844,"in_reply_to":"9a1a9d01_0144e971","updated":"2015-10-05 13:45:21.000000000","message":"As pointed out in an earlier review comment, it is often best to limit changes to the existing code base when possible.  That is what was done here.","commit_id":"5e497093b8388234aabab5691e1f416d12fde360"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"404285db58b67cf318c5229e93ccc767f888b690","unresolved":false,"context_lines":[{"line_number":841,"context_line":"            return name in os.listdir(IP_NETNS_PATH)"},{"line_number":842,"context_line":""},{"line_number":843,"context_line":"        output \u003d self._parent._execute("},{"line_number":844,"context_line":"            [\u0027o\u0027], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":845,"context_line":"        for line in [l.split()[0] for l in output.splitlines()]:"},{"line_number":846,"context_line":"            if name \u003d\u003d line:"},{"line_number":847,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a2fa921_3c52b9de","line":844,"in_reply_to":"9a1a9d01_13cf3680","updated":"2015-10-05 14:40:20.000000000","message":"John - I don\u0027t understand, you *are* changing this code, the code below the \u0027if\u0027 must be run as root now, I was pointing out the best way to make a call use the root helper.","commit_id":"5e497093b8388234aabab5691e1f416d12fde360"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"a84529641b1e86883e06403feedfa7f3939b4ecc","unresolved":false,"context_lines":[{"line_number":214,"context_line":"        if not cfg.CONF.AGENT.use_helper_for_ns_read:"},{"line_number":215,"context_line":"            return os.listdir(IP_NETNS_PATH)"},{"line_number":216,"context_line":""},{"line_number":217,"context_line":"        output \u003d cls._execute([], \u0027netns\u0027, [\u0027list\u0027], run_as_root\u003dTrue)"},{"line_number":218,"context_line":"        return [l.split()[0] for l in output.splitlines()]"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"5a2ca52d_07283499","line":217,"updated":"2015-10-15 22:55:28.000000000","message":"Why is this changing from a tuple to a list?  Seems unrelated.","commit_id":"81823e86328e62850a89aef9f0b609bfc0a6dacd"}],"neutron/tests/functional/agent/linux/test_ip_lib.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"93ec1018b5f63d1e58f3cf78ebc5800139210656","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":92,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":93,"context_line":"        ip.netns.add(namespace)"},{"line_number":94,"context_line":"        self.assertTrue(ip.netns.exists(namespace))"},{"line_number":95,"context_line":"        ip.netns.delete(namespace)"},{"line_number":96,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_53863c66","line":94,"updated":"2015-09-25 22:49:15.000000000","message":"What if this assertion fails? (For example, permission issues in esoteric cases, or changes to the ip.netns.exists method itself). The namespace won\u0027t be deleted.\n\nThis is why we use fixtures in functional tests. Please see neutron/tests/common/net_helpers.NamespaceFixture. There\u0027s many examples of how it\u0027s used, the gist of it is that you instantiate it, and it takes care to delete itself no matter what happens during the test.","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"fd8d46694b5eadcd9f74788cfdde100a783277c4","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":92,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":93,"context_line":"        ip.netns.add(namespace)"},{"line_number":94,"context_line":"        self.assertTrue(ip.netns.exists(namespace))"},{"line_number":95,"context_line":"        ip.netns.delete(namespace)"},{"line_number":96,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_77b0fe43","line":94,"in_reply_to":"9a1a9d01_5172aa4a","updated":"2015-09-27 08:45:37.000000000","message":"+1 to use fixtures to assure we can clean up.","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"7b13ca685f90fa45edbfd7cdfd75446791800b89","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":92,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":93,"context_line":"        ip.netns.add(namespace)"},{"line_number":94,"context_line":"        self.assertTrue(ip.netns.exists(namespace))"},{"line_number":95,"context_line":"        ip.netns.delete(namespace)"},{"line_number":96,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_5172aa4a","line":94,"in_reply_to":"9a1a9d01_53863c66","updated":"2015-09-27 03:59:46.000000000","message":"The logic for this new test case was based on the test case immediately below this one, test_device_exists().  I believe this same type of logic is used there.  \n\nI\u0027ll take a look at fixtures and update the test case that I added.","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"a95c377cd6e6a6c991d676d1d3114c9f5cd3f11b","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        ip \u003d ip_lib.IPWrapper(namespace\u003dnamespace)"},{"line_number":92,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":93,"context_line":"        ip.netns.add(namespace)"},{"line_number":94,"context_line":"        self.assertTrue(ip.netns.exists(namespace))"},{"line_number":95,"context_line":"        ip.netns.delete(namespace)"},{"line_number":96,"context_line":"        self.assertFalse(ip.netns.exists(namespace))"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_89455c18","line":94,"in_reply_to":"9a1a9d01_77b0fe43","updated":"2015-09-28 14:44:16.000000000","message":"Done","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"}],"neutron/tests/unit/agent/linux/test_ip_lib.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"53b452344437e8ed54311d5db8c14219a4eeeea2","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_5512cdb5","line":1149,"updated":"2015-09-24 23:37:01.000000000","message":"Please remove these unit tests and ensure that we have functional tests instead (They should be trivial to implement if they don\u0027t exist).","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"e52fafdc89f2e9cf8abd40bb2a1ae6382eb5ae5c","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_02863413","line":1149,"in_reply_to":"9a1a9d01_259d9465","updated":"2015-09-25 21:18:47.000000000","message":"Functional test has been added in PS #2.","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"b4306745e83e7efa62fcb4540f5cc8498d685751","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_759a7116","line":1149,"in_reply_to":"9a1a9d01_5512cdb5","updated":"2015-09-24 23:41:46.000000000","message":"There are a lot of unit tests in this class and file.  Which unit tests are do you think  should be moved over to functional tests?","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"cdf750d9ced3c8b69a72a831f136cdef1a5f16b7","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_abc89875","line":1149,"in_reply_to":"9a1a9d01_55315b0a","updated":"2015-09-25 13:29:49.000000000","message":"I\u0027m still a little unclear on the functional test required here.  I have never written any functional tests yet, so I need to learn how that is done.  I\u0027m sure that will help.\n\nHere are my initial thoughts: create a private network, create a subnet (with dhcp-enabled).  Ensure qdhcp namespace is created by checking for existence of  qdhcp-\u003cnetwork id\u003e  file in /var/run/netns/ ?  I could also run the logic to create the qrouter namespace and check for that too.","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"40b51cd05c2d89426ce71fca01e25b1649b7853c","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_55315b0a","line":1149,"in_reply_to":"9a1a9d01_759a7116","updated":"2015-09-25 12:49:52.000000000","message":"Only this test.","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"4a0f474b96fe5368b0414c4c1547b51d648ac5a2","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_798fc323","line":1149,"in_reply_to":"9a1a9d01_759a7116","updated":"2015-09-25 07:58:08.000000000","message":"seems you need to do at least this case.","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"98a1d300381b1253a1f152899173cbe54ae9a3ef","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_259d9465","line":1149,"in_reply_to":"9a1a9d01_abc89875","updated":"2015-09-25 14:36:53.000000000","message":"I think in your functional test, you just need run a command \u0027ip netns add test\u0027, and then use our new netns_cmd.exists(\u0027test\u0027) to tell if it is true.","commit_id":"5ce8ab6f40be47fb3e0f5bd00c9b34f8ad0610be"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"93ec1018b5f63d1e58f3cf78ebc5800139210656","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_b342383d","line":1149,"updated":"2015-09-25 22:49:15.000000000","message":"I think you can delete this test. It doesn\u0027t add anything with the existence of the functional test. Actually, it only detracts.","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"7b13ca685f90fa45edbfd7cdfd75446791800b89","unresolved":false,"context_lines":[{"line_number":1146,"context_line":"            self.netns_cmd.delete(\u0027ns\u0027)"},{"line_number":1147,"context_line":"            self._assert_sudo([], (\u0027delete\u0027, \u0027ns\u0027), use_root_namespace\u003dTrue)"},{"line_number":1148,"context_line":""},{"line_number":1149,"context_line":"    def test_namespace_exists(self):"},{"line_number":1150,"context_line":"        ip_netns_path \u003d \u0027/var/run/netns/\u0027"},{"line_number":1151,"context_line":"        sample_ns \u003d \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027"},{"line_number":1152,"context_line":"        netns_cmd \u003d ip_lib.IpNetnsCommand(ip_lib.SubProcessBase())"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_f18f3e21","line":1149,"in_reply_to":"9a1a9d01_b342383d","updated":"2015-09-27 03:59:46.000000000","message":"Done","commit_id":"8c6c3f268f9cead7613b67243a025e9ec8417269"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fc044445f72ddc0bfeda80d56147d5e7ba4d2e41","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                         [\u002712345678-1234-5678-abcd-1234567890ab\u0027,"},{"line_number":282,"context_line":"                          \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027,"},{"line_number":283,"context_line":"                          \u0027cccccccc-cccc-cccc-cccc-cccccccccccc\u0027])"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        self.execute.assert_called_once_with([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def test_get_namespaces_iproute2_4(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_8201e408","side":"PARENT","line":284,"updated":"2015-10-02 20:56:30.000000000","message":"nit:  Avoid extra whitespace change.  (i.e. leave the blank line)","commit_id":"99d24edfa8db3e71db92639e70ef63750902935b"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"fc93888d68d83445e482db1f2ee2094affafd712","unresolved":false,"context_lines":[{"line_number":281,"context_line":"                         [\u002712345678-1234-5678-abcd-1234567890ab\u0027,"},{"line_number":282,"context_line":"                          \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027,"},{"line_number":283,"context_line":"                          \u0027cccccccc-cccc-cccc-cccc-cccccccccccc\u0027])"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        self.execute.assert_called_once_with([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def test_get_namespaces_iproute2_4(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_e13535db","side":"PARENT","line":284,"in_reply_to":"9a1a9d01_8201e408","updated":"2015-10-02 21:17:51.000000000","message":"Done","commit_id":"99d24edfa8db3e71db92639e70ef63750902935b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fc044445f72ddc0bfeda80d56147d5e7ba4d2e41","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                         [\u002712345678-1234-5678-abcd-1234567890ab\u0027,"},{"line_number":292,"context_line":"                          \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027,"},{"line_number":293,"context_line":"                          \u0027cccccccc-cccc-cccc-cccc-cccccccccccc\u0027])"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.execute.assert_called_once_with([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    def test_add_tuntap(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_e508ea2a","side":"PARENT","line":294,"updated":"2015-10-02 20:56:30.000000000","message":"ditto","commit_id":"99d24edfa8db3e71db92639e70ef63750902935b"},{"author":{"_account_id":9970,"name":"John Kasperski","email":"jckasper@linux.vnet.ibm.com","username":"jckasper"},"change_message_id":"fc93888d68d83445e482db1f2ee2094affafd712","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                         [\u002712345678-1234-5678-abcd-1234567890ab\u0027,"},{"line_number":292,"context_line":"                          \u0027bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb\u0027,"},{"line_number":293,"context_line":"                          \u0027cccccccc-cccc-cccc-cccc-cccccccccccc\u0027])"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"        self.execute.assert_called_once_with([], \u0027netns\u0027, (\u0027list\u0027,))"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    def test_add_tuntap(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a1a9d01_813479de","side":"PARENT","line":294,"in_reply_to":"9a1a9d01_e508ea2a","updated":"2015-10-02 21:17:51.000000000","message":"Done","commit_id":"99d24edfa8db3e71db92639e70ef63750902935b"}]}
