)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6908,"name":"Simon Leinen","email":"simon.leinen@gmail.com","username":"simon-leinen"},"change_message_id":"e0a577ecc5cc549cbe5cf70bfe2c5cf4ed5e268b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check if namespace exists before getting devices"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If a neutron router has no ports defined, his namespace is deleted."},{"line_number":10,"context_line":"It is required to check if the namespace exists before calling"},{"line_number":11,"context_line":"iproute2 commands against the namespace."},{"line_number":12,"context_line":"It is not enough for the string of the namespace uuid to be defined,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a122d0e_012a892c","line":9,"updated":"2016-04-21 16:55:19.000000000","message":"Minor nit: his namespace -\u003e its namespace","commit_id":"ceb793c750cc60bf210a3a9cf5062f350654d0f2"},{"author":{"_account_id":6908,"name":"Simon Leinen","email":"simon.leinen@gmail.com","username":"simon-leinen"},"change_message_id":"e0a577ecc5cc549cbe5cf70bfe2c5cf4ed5e268b","unresolved":false,"context_lines":[{"line_number":11,"context_line":"iproute2 commands against the namespace."},{"line_number":12,"context_line":"It is not enough for the string of the namespace uuid to be defined,"},{"line_number":13,"context_line":"the namespace must really exist on the network node."},{"line_number":14,"context_line":"Otherwise the vpn-agent.log will be flooded with messages like"},{"line_number":15,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":16,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"},{"line_number":17,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1a122d0e_61cd3d86","line":14,"updated":"2016-04-21 16:55:19.000000000","message":"Is this specific to the VPN agent, or will the problem also occur with the \"vanilla\" L3 agent? If so, will your patch fix it for the L3 agent as well?","commit_id":"ceb793c750cc60bf210a3a9cf5062f350654d0f2"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"1173953b8f9e248935bed7892494764b58865a2d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"Otherwise the agent log file will be flooded with messages like"},{"line_number":15,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":16,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Related-bug: 1573073"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I744ef11529f9da5cbfdb812de0b35b95f9d078bb"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"1a122d0e_6673f74e","line":17,"updated":"2016-04-27 12:16:23.000000000","message":"It should probably be mentioned, that the proposed change only reduces the probability of error messages (as Dustin Lundquist\u0027s noted).","commit_id":"0aa6924413e89b90049edb62c827be94b2d816f7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f0a839e63b6abbbac0031ff7009683584c0d2d71","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check if namespace exists before getting devices"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If a neutron router has no ports defined, its namespace is deleted."},{"line_number":10,"context_line":"It is required to check if the namespace exists before calling"},{"line_number":11,"context_line":"iproute2 commands against the namespace."},{"line_number":12,"context_line":"It is not enough for the string of the namespace uuid to be defined,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"1a122d0e_03b8b529","line":9,"updated":"2016-05-02 21:54:40.000000000","message":"It is deleted by the cleanup script, which is an important distinction, this makes it sound like it\u0027s deleted by the agent.","commit_id":"b5b075e939a474c2d4e09c760d9746b090095a8b"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"f0a839e63b6abbbac0031ff7009683584c0d2d71","unresolved":false,"context_lines":[{"line_number":10,"context_line":"It is required to check if the namespace exists before calling"},{"line_number":11,"context_line":"iproute2 commands against the namespace."},{"line_number":12,"context_line":"It is not enough for the string of the namespace uuid to be defined,"},{"line_number":13,"context_line":"the namespace must really exist on the network node."},{"line_number":14,"context_line":"Otherwise the agent log file will be flooded with messages like"},{"line_number":15,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":16,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"1a122d0e_435c6df0","line":13,"updated":"2016-05-02 21:54:40.000000000","message":"I think it would be better if these comments made a specific mention of get_devices(), since this patch isn\u0027t changing the behavior of all the other places in ip_lib that use namespaces without checking first.","commit_id":"b5b075e939a474c2d4e09c760d9746b090095a8b"},{"author":{"_account_id":18573,"name":"Petri Kemppainen","email":"petri.kemppainen@nokia.com","username":"petrkemp"},"change_message_id":"e482df2680e704b3bf82834be3bd6804c2092289","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Check if namespace exists before getting devices"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"If a neutron router has no ports defined, its namespace is deleted"},{"line_number":10,"context_line":"by the cronjob /etc/cron.d/neutron-l3-agent-netns-cleanup"},{"line_number":11,"context_line":"It is required to check if the namespace exists before calling"},{"line_number":12,"context_line":"iproute2 commands against the namespace."},{"line_number":13,"context_line":"It is not enough for the string of the namespace uuid to be defined,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"dab17558_598645ba","line":10,"updated":"2016-05-06 10:18:52.000000000","message":"Period is missing \u0027.\u0027","commit_id":"e6242511866b35062cc505c60c44811322cc7da8"},{"author":{"_account_id":18573,"name":"Petri Kemppainen","email":"petri.kemppainen@nokia.com","username":"petrkemp"},"change_message_id":"e482df2680e704b3bf82834be3bd6804c2092289","unresolved":false,"context_lines":[{"line_number":12,"context_line":"iproute2 commands against the namespace."},{"line_number":13,"context_line":"It is not enough for the string of the namespace uuid to be defined,"},{"line_number":14,"context_line":"the namespace must really exist on the network node."},{"line_number":15,"context_line":"This patch checks if the namespace exists before calling get_devices()"},{"line_number":16,"context_line":"Otherwise the agent log file will be flooded with messages like"},{"line_number":17,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":18,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"dab17558_14876410","line":15,"updated":"2016-05-06 10:18:52.000000000","message":"Period is missing.","commit_id":"e6242511866b35062cc505c60c44811322cc7da8"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"53090370c37ceb0829feb91734dbca1196d90643","unresolved":false,"context_lines":[{"line_number":12,"context_line":"iproute2 commands against the namespace."},{"line_number":13,"context_line":"It is not enough for the string of the namespace uuid to be defined,"},{"line_number":14,"context_line":"the namespace must really exist on the network node."},{"line_number":15,"context_line":"This patch checks if the namespace exists before calling get_devices()"},{"line_number":16,"context_line":"Otherwise the agent log file will be flooded with messages like"},{"line_number":17,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":18,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"dab17558_b4f2d898","line":15,"range":{"start_line":15,"start_character":42,"end_line":15,"end_character":70},"updated":"2016-05-06 10:22:03.000000000","message":"nit: the check is performed by \u0027get_devices\u0027 itself, but not before it.","commit_id":"e6242511866b35062cc505c60c44811322cc7da8"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":15,"context_line":"This patch checks if the namespace exists when calling get_devices()."},{"line_number":16,"context_line":"Otherwise the agent log file will be flooded with messages like"},{"line_number":17,"context_line":"Cannot open network namespace \"qrouter-\u003cuuid\u003e\": No such file or directory"},{"line_number":18,"context_line":"Failed to process compatible router \u0027\u003cuuid\u003e\u0027"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Related-bug: 1573073"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":25,"id":"ba5da102_dd3bc936","line":18,"updated":"2016-11-01 03:00:11.000000000","message":"We\u0027ve been working on fixing a lot of the code paths to check for namespace existence (and reduce this error), but this change is still ok for me.","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"}],"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"8f6143d4c74b132571a556f78af4ad5c3e25bf7c","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        if self.namespace and self.netns.exists(self.namespace):"},{"line_number":123,"context_line":"            # we call out manually because in order to avoid screen scraping"},{"line_number":124,"context_line":"            # iproute2 we use find to see what is in the sysfs directory, as"},{"line_number":125,"context_line":"            # suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_ffe5f4a7","line":122,"range":{"start_line":122,"start_character":25,"end_line":122,"end_character":63},"updated":"2016-04-25 21:33:02.000000000","message":"This check should be performed separately from self.namespace check (e.g. moved inside the \u0027if\u0027 block). Otherwise get_devices would return the devices of the current/default namespace (see \u0027else\u0027 block) which could lead to unexpected/incorrect results.","commit_id":"12740365abd97bcdf3d5ca47f94ac79fca757548"},{"author":{"_account_id":11255,"name":"Dustin Lundquist","username":"dustin.lundquist","inactive":true},"change_message_id":"6ed144f48aafef526b75193bb0936707b655f5dc","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        if self.namespace:"},{"line_number":123,"context_line":"            if self.netns.exists(self.namespace):"},{"line_number":124,"context_line":"                # we call out manually because in order to avoid screen scraping"},{"line_number":125,"context_line":"                # iproute2 we use find to see what is in the sysfs directory, as"},{"line_number":126,"context_line":"                # suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":4,"id":"1a122d0e_843d82df","line":123,"updated":"2016-04-26 16:52:47.000000000","message":"There is a potential race here: the namespace may exist during the test, but have been deleted by the time `ip netns exec` is executed.","commit_id":"e952706c279ddf6b5324e97eafaaa82c95a119b3"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"c2d1fda19e2f6c91780865fb432b79fc18fd4e16","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        if self.netns.exists(self.namespace):"},{"line_number":123,"context_line":"            # we call out manually because in order to avoid screen scraping"},{"line_number":124,"context_line":"            # iproute2 we use find to see what is in the sysfs directory, as"},{"line_number":125,"context_line":"            # suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":6,"id":"1a122d0e_2871d844","line":122,"range":{"start_line":122,"start_character":8,"end_line":122,"end_character":44},"updated":"2016-04-26 22:52:23.000000000","message":"The \u0027else\u0027 branch (i.e. \u0027not self.namespaces\u0027) is here to handle the default namespace devices (i.e. those you can see with, say \u0027ip link\u0027).\n\nWith your proposed change IPWrapper(\u0027some-non-existent-namespace\u0027).get_devices() would become an equivalent of IPWrapper().get_devices(), and instead of returning devices for \u0027some-non-existent-namespace\u0027 (i.e. an empty list) it would return the devices from the default namespace.","commit_id":"eb48a1fe50e99625a494edb205005bef5114292d"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"f7b97307e5ea3ff7860cef12fbde26188a75f9fe","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        if self.netns.exists(self.namespace):"},{"line_number":123,"context_line":"            # we call out manually because in order to avoid screen scraping"},{"line_number":124,"context_line":"            # iproute2 we use find to see what is in the sysfs directory, as"},{"line_number":125,"context_line":"            # suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":6,"id":"1a122d0e_0a1def61","line":122,"range":{"start_line":122,"start_character":8,"end_line":122,"end_character":44},"in_reply_to":"1a122d0e_2871d844","updated":"2016-04-27 03:36:31.000000000","message":"Good catch. +1","commit_id":"eb48a1fe50e99625a494edb205005bef5114292d"},{"author":{"_account_id":14605,"name":"vikram.choudhary","email":"vikschw@gmail.com","username":"vikram.choudhary"},"change_message_id":"0fb11d8e3add0e4afd1c1e6575b7e59cd13c3e85","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        output \u003d []"},{"line_number":123,"context_line":"        if self.namespace:"},{"line_number":124,"context_line":"            if self.netns.exists(self.namespace):"},{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"},{"line_number":126,"context_line":"                # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":127,"context_line":"                # directory, as suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":10,"id":"1a122d0e_0e6683ba","line":124,"updated":"2016-04-28 04:44:23.000000000","message":"What will be the behaviour if netns doesn\u0027t exist? Doesn\u0027t we need to execute the else block?","commit_id":"ff4b2b00526c40ba19e2c2ae9fb5b7436ceddccc"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"b65a1e69c55c4d39fe93969cd2c2f02487398716","unresolved":false,"context_lines":[{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        output \u003d []"},{"line_number":123,"context_line":"        if self.namespace:"},{"line_number":124,"context_line":"            if self.netns.exists(self.namespace):"},{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"},{"line_number":126,"context_line":"                # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":127,"context_line":"                # directory, as suggested by Stephen Hemminger (iproute2 dev)."}],"source_content_type":"text/x-python","patch_set":10,"id":"1a122d0e_d1ac2cef","line":124,"in_reply_to":"1a122d0e_0e6683ba","updated":"2016-04-28 05:59:28.000000000","message":"If netns doesn\u0027t exist, output will keep empty, and so does retval.\n\"the else block\", do you mean L135-139? If so, it shouldn\u0027t be executed, please check comments in https://review.openstack.org/#/c/309050/6/neutron/agent/linux/ip_lib.py.","commit_id":"ff4b2b00526c40ba19e2c2ae9fb5b7436ceddccc"},{"author":{"_account_id":21647,"name":"wangqianyu","email":"wang.qianyu@zte.com.cn"},"change_message_id":"36c466f80d0d82b10f378ab4f6f6dddae44e5eff","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        output \u003d []"},{"line_number":123,"context_line":"        if self.namespace:"},{"line_number":124,"context_line":"            if self.netns.exists(self.namespace):"},{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a122d0e_9ae92982","line":122,"updated":"2016-04-28 09:26:39.000000000","message":"ok","commit_id":"8730ca0adfbb67b6062ed44f89cd4872e5d79888"},{"author":{"_account_id":11159,"name":"Hong Hui Xiao","email":"honghui_xiao@yeah.net","username":"HongHuiXiao"},"change_message_id":"ba546182f9cd4ffda0eff769ab6c8680d10cd4cb","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                                       run_as_root\u003dTrue,"},{"line_number":132,"context_line":"                                       log_fail_as_error\u003dself.log_fail_as_error"},{"line_number":133,"context_line":"                                       ).split()"},{"line_number":134,"context_line":"        # if self.namespace is not defined handle the default namespace devices"},{"line_number":135,"context_line":"        else:"},{"line_number":136,"context_line":"            output \u003d ("},{"line_number":137,"context_line":"                i for i in os.listdir(SYS_NET_PATH)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_4ea30901","line":134,"range":{"start_line":134,"start_character":0,"end_line":134,"end_character":79},"updated":"2016-05-01 22:12:16.000000000","message":"nit: I think this comment should be under \"else:\"","commit_id":"2989966afb162e0b8967ca3f1b20f4f639fb69ed"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"f63b25aeac7a393b0de7533689473d506765f0f3","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"},{"line_number":126,"context_line":"                # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":127,"context_line":"                # directory, as suggested by Stephen Hemminger (iproute2 dev)."},{"line_number":128,"context_line":"                output \u003d utils.execute([\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace,"},{"line_number":129,"context_line":"                                        \u0027find\u0027, SYS_NET_PATH, \u0027-maxdepth\u0027, \u00271\u0027,"},{"line_number":130,"context_line":"                                        \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027],"},{"line_number":131,"context_line":"                                       run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":21,"id":"dab17558_04d27100","line":128,"updated":"2016-05-06 23:45:27.000000000","message":"And what if the cron job is executed after line 124 but before 128?\n\nI would prefer to stick the execute command in a try/except block and catch the exception.","commit_id":"98176cf4538518a224608afc833286788a4382bd"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"4b36b407d3a41f5663f915b88f7067613c9b523a","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"},{"line_number":126,"context_line":"                # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":127,"context_line":"                # directory, as suggested by Stephen Hemminger (iproute2 dev)."},{"line_number":128,"context_line":"                output \u003d utils.execute([\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace,"},{"line_number":129,"context_line":"                                        \u0027find\u0027, SYS_NET_PATH, \u0027-maxdepth\u0027, \u00271\u0027,"},{"line_number":130,"context_line":"                                        \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027],"},{"line_number":131,"context_line":"                                       run_as_root\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":21,"id":"dab17558_6b596f5a","line":128,"in_reply_to":"dab17558_04d27100","updated":"2016-05-09 08:12:26.000000000","message":"This is a good point. I didn\u0027t realize the issue was that we were racing with a cronjob. Adjust this to try: except: then check if the namespace exists, if it does, reraise, otherwise continue","commit_id":"98176cf4538518a224608afc833286788a4382bd"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"8da7e88c5bdd5f424123ef3818ed3928a1de5a84","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                        \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027],"},{"line_number":133,"context_line":"                        run_as_root\u003dTrue,"},{"line_number":134,"context_line":"                        log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":135,"context_line":"                except RuntimeError:"},{"line_number":136,"context_line":"                    # We race with a cron job that deletes the namespaces."},{"line_number":137,"context_line":"                    # Just return a empty list if the namespace is deleted."},{"line_number":138,"context_line":"                    # See bug #1573073"}],"source_content_type":"text/x-python","patch_set":23,"id":"dab17558_0a0d3490","line":135,"updated":"2016-05-09 13:11:56.000000000","message":"Did you consider checking the error message to check if the error is the existence of the namespace, and not other errors?","commit_id":"49485ddda88e2c176f04996f37688a6930b9c3fc"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c0becc56b63291bd0e49884695b94f1df8ddc642","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                # we call out manually because in order to avoid screen"},{"line_number":126,"context_line":"                # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":127,"context_line":"                # directory, as suggested by Stephen Hemminger (iproute2 dev)."},{"line_number":128,"context_line":"                try:"},{"line_number":129,"context_line":"                    cmd \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace,"},{"line_number":130,"context_line":"                          \u0027find\u0027, SYS_NET_PATH, \u0027-maxdepth\u0027, \u00271\u0027,"},{"line_number":131,"context_line":"                          \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027]"}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_2d978391","line":128,"updated":"2016-08-16 09:27:25.000000000","message":"what I mean was something like the following:\n\nif self.namespace:\n    try:\n        cmd \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, ...\n        output \u003d utils.execute(cmd, ...)\n    except Exception as e:\n        with excutils.save_and_reraise_exception() as ectx:\n            if not self.netns.exists(self.namesapce):\n                ctx.reraise \u003d False\n                return []","commit_id":"f4a8e12d5b299c7b319d19700678aaf35c7b8615"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"01fd74e58f9cb0c18b1521688e00e3d37ef59b6b","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                        cmd,"},{"line_number":134,"context_line":"                        run_as_root\u003dTrue,"},{"line_number":135,"context_line":"                        log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":136,"context_line":"                except RuntimeError as e:"},{"line_number":137,"context_line":"                    # We race with a cron job that deletes the namespaces."},{"line_number":138,"context_line":"                    # Just return a empty list if the namespace is deleted."},{"line_number":139,"context_line":"                    # See bug #1573073"}],"source_content_type":"text/x-python","patch_set":24,"id":"dab17558_9bd3ce5f","line":136,"range":{"start_line":136,"start_character":16,"end_line":136,"end_character":41},"updated":"2016-05-11 09:39:51.000000000","message":"You could probably move netns.exists check inside the except block like this:\n\nif self.namespace:\n  try:\n    exec\n  except:\n    if netns.exists: # \u003c-- here\n      log\n      return retval\n    reraise","commit_id":"f4a8e12d5b299c7b319d19700678aaf35c7b8615"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"c0becc56b63291bd0e49884695b94f1df8ddc642","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                        log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":136,"context_line":"                except RuntimeError as e:"},{"line_number":137,"context_line":"                    # We race with a cron job that deletes the namespaces."},{"line_number":138,"context_line":"                    # Just return a empty list if the namespace is deleted."},{"line_number":139,"context_line":"                    # See bug #1573073"},{"line_number":140,"context_line":"                    LOG.debug(\"Exception while get device from namespace. \""},{"line_number":141,"context_line":"                              \"Command: %s. Exception: %s\", cmd, e)"}],"source_content_type":"text/x-python","patch_set":24,"id":"3ac371cc_0d92879f","line":138,"updated":"2016-08-16 09:27:25.000000000","message":"I think in this particular case it\u0027s fine because if I ask for all particular devices in namespace \u0027foo\u0027 and namespace \u0027foo\u0027 doesn\u0027t even exist, then there are certainly no devices in the \u0027foo\u0027 namespace.","commit_id":"f4a8e12d5b299c7b319d19700678aaf35c7b8615"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"ee0e2cfbc4be674d011cef265ed8cacc8812cbd1","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                        log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":136,"context_line":"                except RuntimeError as e:"},{"line_number":137,"context_line":"                    # We race with a cron job that deletes the namespaces."},{"line_number":138,"context_line":"                    # Just return a empty list if the namespace is deleted."},{"line_number":139,"context_line":"                    # See bug #1573073"},{"line_number":140,"context_line":"                    LOG.debug(\"Exception while get device from namespace. \""},{"line_number":141,"context_line":"                              \"Command: %s. Exception: %s\", cmd, e)"}],"source_content_type":"text/x-python","patch_set":24,"id":"dab17558_9451c132","line":138,"range":{"start_line":138,"start_character":22,"end_line":138,"end_character":74},"updated":"2016-05-17 16:30:51.000000000","message":"Is this really the behavior we want from a consumer (caller) perspective? My line of thinking is that consumers may create an IPWrapper for a said namespace, but they are insulated from the fact that the namespace they expected doesn\u0027t even exist. They call get_devices() and get an empty list, looks like all is good with no devices when in fact the said namespace doesn\u0027t exist. Although it\u0027s more burden on the caller, I\u0027d lean towards making them deal with the error as it serves an indication of something here (e.g. no namespace, or something else).","commit_id":"f4a8e12d5b299c7b319d19700678aaf35c7b8615"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        if self.namespace:"},{"line_number":124,"context_line":"            # we call out manually because in order to avoid screen"},{"line_number":125,"context_line":"            # scraping iproute2 we use find to see what is in the sysfs"},{"line_number":126,"context_line":"            # directory, as suggested by Stephen Hemminger (iproute2 dev)."},{"line_number":127,"context_line":"            try:"},{"line_number":128,"context_line":"                cmd \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace,"},{"line_number":129,"context_line":"                      \u0027find\u0027, SYS_NET_PATH, \u0027-maxdepth\u0027, \u00271\u0027,"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5da102_bd21b54f","line":126,"updated":"2016-11-01 03:00:11.000000000","message":"Since the existing comment was fine and not causing pep8 issues, let\u0027s just leave it as it was since it\u0027s just unnecessary changes.","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    run_as_root\u003dTrue,"},{"line_number":134,"context_line":"                    log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":135,"context_line":"            except RuntimeError as e:"},{"line_number":136,"context_line":"                # We race with a cron job that deletes the namespaces."},{"line_number":137,"context_line":"                # Just return a empty list if the namespace is deleted."},{"line_number":138,"context_line":"                # See bug #1573073"},{"line_number":139,"context_line":"                with excutils.save_and_reraise_exception() as ctx:"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5da102_5dbed9d4","line":136,"updated":"2016-11-01 03:00:11.000000000","message":"s//We could be racing with a cron job deleting namespaces.","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            except RuntimeError as e:"},{"line_number":136,"context_line":"                # We race with a cron job that deletes the namespaces."},{"line_number":137,"context_line":"                # Just return a empty list if the namespace is deleted."},{"line_number":138,"context_line":"                # See bug #1573073"},{"line_number":139,"context_line":"                with excutils.save_and_reraise_exception() as ctx:"},{"line_number":140,"context_line":"                    if not self.netns.exists(self.namespace):"},{"line_number":141,"context_line":"                        ctx.reraise \u003d False"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5da102_5da5f9b2","line":138,"updated":"2016-11-01 03:00:11.000000000","message":"nit: I don\u0027t see the point in having the bug number here","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                with excutils.save_and_reraise_exception() as ctx:"},{"line_number":140,"context_line":"                    if not self.netns.exists(self.namespace):"},{"line_number":141,"context_line":"                        ctx.reraise \u003d False"},{"line_number":142,"context_line":"                        LOG.debug(\"Exception while get device from namespace. \""},{"line_number":143,"context_line":"                                  \"Command: %s. Exception: %s\", cmd, e)"},{"line_number":144,"context_line":"                        return []"},{"line_number":145,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5da102_3d892527","line":142,"updated":"2016-11-01 03:00:11.000000000","message":"s/while get device/retrieving device list/","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"6a8be2c111c2630222cf82fa02606045f7819fcd","unresolved":false,"context_lines":[{"line_number":144,"context_line":"                        return []"},{"line_number":145,"context_line":"        else:"},{"line_number":146,"context_line":"            # if self.namespace is not defined handle the default namespace"},{"line_number":147,"context_line":"            # devices"},{"line_number":148,"context_line":"            output \u003d ("},{"line_number":149,"context_line":"                i for i in os.listdir(SYS_NET_PATH)"},{"line_number":150,"context_line":"                if os.path.islink(os.path.join(SYS_NET_PATH, i))"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5da102_5de179cf","line":147,"updated":"2016-11-01 03:00:11.000000000","message":"nit: unnecessary comment imo as the code really hasn\u0027t changed","commit_id":"78b85e6af1204f0be647e52f3875d40f37cb8e64"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"53ebd3eaa71fcdee5e5ee52d3d0d9c508ee2c0d8","unresolved":false,"context_lines":[{"line_number":126,"context_line":"            # suggested by Stephen Hemminger (iproute2 dev)."},{"line_number":127,"context_line":"            try:"},{"line_number":128,"context_line":"                cmd \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace,"},{"line_number":129,"context_line":"                      \u0027find\u0027, SYS_NET_PATH, \u0027-maxdepth\u0027, \u00271\u0027,"},{"line_number":130,"context_line":"                      \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027]"},{"line_number":131,"context_line":"                output \u003d utils.execute("},{"line_number":132,"context_line":"                    cmd,"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba5da102_da302404","line":129,"updated":"2016-11-01 11:33:11.000000000","message":"nit - please fix alignment here \u0027 should be under \u0027","commit_id":"6b767f97936f7eff54ba16edcf06482b61884c07"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"001cb12c4742df7926fea0968697d5eb7405cad6","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def get_devices(self, exclude_loopback\u003dFalse):"},{"line_number":121,"context_line":"        retval \u003d []"},{"line_number":122,"context_line":"        output \u003d []"},{"line_number":123,"context_line":"        if self.namespace:"},{"line_number":124,"context_line":"            # we call out manually because in order to avoid screen scraping"},{"line_number":125,"context_line":"            # iproute2 we use find to see what is in the sysfs directory, as"}],"source_content_type":"text/x-python","patch_set":27,"id":"ba5da102_10e406df","line":122,"updated":"2016-11-02 15:53:17.000000000","message":"nit this is not need, it\u0027s no used after all :)","commit_id":"685cc8e9569a5aec399740a06acd6f5c8753ad04"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"bb9a2751a2500e572da6f8c5953b4b629b350d60","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    cmd,"},{"line_number":134,"context_line":"                    run_as_root\u003dTrue,"},{"line_number":135,"context_line":"                    log_fail_as_error\u003dself.log_fail_as_error).split()"},{"line_number":136,"context_line":"            except RuntimeError as e:"},{"line_number":137,"context_line":"                # We could be racing with a cron job deleting namespaces."},{"line_number":138,"context_line":"                # Just return a empty list if the namespace is deleted."},{"line_number":139,"context_line":"                with excutils.save_and_reraise_exception() as ctx:"}],"source_content_type":"text/x-python","patch_set":31,"id":"ba5da102_04081027","line":136,"updated":"2016-11-03 18:54:15.000000000","message":"whoops, pep8 failure here for not using e. I will update the patch really quick.","commit_id":"7d2354657165ef6143e878f3e1de1481fa277bf4"}],"neutron/agent/linux/ipset_manager.py":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"31b54958a3c206d8def31428f6cab16bd6c3f486","unresolved":false,"context_lines":[{"line_number":148,"context_line":"            cmd_ns.extend([\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace])"},{"line_number":149,"context_line":"            cmd_ns.extend(cmd)"},{"line_number":150,"context_line":"            ip \u003d ip_lib.IPWrapper()"},{"line_number":151,"context_line":"            if ip.netns.exists(self.namespace):"},{"line_number":152,"context_line":"                self.execute(cmd_ns, run_as_root\u003dTrue, process_input\u003dinput,"},{"line_number":153,"context_line":"                             check_exit_code\u003dfail_on_errors)"},{"line_number":154,"context_line":"        else:"},{"line_number":155,"context_line":"            cmd_ns.extend(cmd)"},{"line_number":156,"context_line":"            self.execute(cmd_ns, run_as_root\u003dTrue, process_input\u003dinput,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_b20ebc38","line":153,"range":{"start_line":151,"start_character":12,"end_line":153,"end_character":60},"updated":"2016-04-28 17:30:20.000000000","message":"I believe it deserves an exception to fail fast. This function is not idempotent and hiding the problem from its caller would likely lead to unexpected results later.","commit_id":"63e54442d59fd6aeb317e87f4c6cb2932cd8c060"}],"neutron/agent/linux/iptables_manager.py":[{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"5855e7da3d2af4d0ca099d34d79d28145008acd8","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            if self.namespace:"},{"line_number":507,"context_line":"                args \u003d [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, self.namespace] + args"},{"line_number":508,"context_line":"                if self.netns.exists(self.namespace):"},{"line_number":509,"context_line":"                    save_output \u003d self.execute(args, run_as_root\u003dTrue)"},{"line_number":510,"context_line":"            else:"},{"line_number":511,"context_line":"                save_output \u003d self.execute(args, run_as_root\u003dTrue)"},{"line_number":512,"context_line":"            all_lines \u003d save_output.split(\u0027\\n\u0027)"},{"line_number":513,"context_line":"            commands \u003d []"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a122d0e_44c5138c","line":510,"range":{"start_line":509,"start_character":20,"end_line":510,"end_character":17},"updated":"2016-04-27 12:56:16.000000000","message":"missed initialisation of save_output if netns does not exist","commit_id":"2e5e56075c5dfb8dcca9cf020d79a7e974bc9a1b"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"31b54958a3c206d8def31428f6cab16bd6c3f486","unresolved":false,"context_lines":[{"line_number":510,"context_line":"                if ip.netns.exists(self.namespace):"},{"line_number":511,"context_line":"                    save_output \u003d self.execute(args, run_as_root\u003dTrue)"},{"line_number":512,"context_line":"                else:"},{"line_number":513,"context_line":"                    LOG.debug(\"IPTablesManager.apply tried to access a not \""},{"line_number":514,"context_line":"                              \"existing namespace on the network node.\")"},{"line_number":515,"context_line":"                    return all_commands"},{"line_number":516,"context_line":"            else:"},{"line_number":517,"context_line":"                save_output \u003d self.execute(args, run_as_root\u003dTrue)"},{"line_number":518,"context_line":"            all_lines \u003d save_output.split(\u0027\\n\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_1265f043","line":515,"range":{"start_line":513,"start_character":20,"end_line":515,"end_character":39},"updated":"2016-04-28 17:30:20.000000000","message":"same","commit_id":"63e54442d59fd6aeb317e87f4c6cb2932cd8c060"}],"neutron/tests/unit/agent/linux/test_ip_lib.py":[{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"f63db68d30fe9060fb454ff7deda47daf5f8fe67","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        fake_str.split.return_value \u003d [\u0027lo\u0027]"},{"line_number":276,"context_line":"        mocked_execute.return_value \u003d fake_str"},{"line_number":277,"context_line":"        retval \u003d ip_lib.IPWrapper().ensure_namespace(\u0027foo\u0027).get_devices()"},{"line_number":278,"context_line":"        mocked_execute.assert_called_once_with("},{"line_number":279,"context_line":"                [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, \u0027foo\u0027, \u0027find\u0027, \u0027/sys/class/net\u0027,"},{"line_number":280,"context_line":"                 \u0027-maxdepth\u0027, \u00271\u0027, \u0027-type\u0027, \u0027l\u0027, \u0027-printf\u0027, \u0027%f \u0027],"},{"line_number":281,"context_line":"                run_as_root\u003dTrue, log_fail_as_error\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a122d0e_f75fd80c","line":278,"range":{"start_line":278,"start_character":8,"end_line":278,"end_character":47},"updated":"2016-04-26 05:11:41.000000000","message":"try something like assert_has_calls, since IpNetnsCommand.exists will also call utils.execute, or you can mock IpNetnsCommand.exists to directly return True.","commit_id":"12740365abd97bcdf3d5ca47f94ac79fca757548"},{"author":{"_account_id":21273,"name":"Ilya Chukhnakov","email":"Ilya.chukhnakov@gmail.com","username":"ichukhnakov"},"change_message_id":"1173953b8f9e248935bed7892494764b58865a2d","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        fake_str.split.return_value \u003d [\u0027lo\u0027]"},{"line_number":276,"context_line":"        mocked_execute.return_value \u003d fake_str"},{"line_number":277,"context_line":"        with mock.patch.object(ip_lib, \u0027IpNetnsCommand\u0027) as ip_ns_cmd:"},{"line_number":278,"context_line":"            ip_ns_cmd.exists.return_value \u003d True"},{"line_number":279,"context_line":"            retval \u003d ip_lib.IPWrapper(namespace\u003d\u0027foo\u0027).get_devices()"},{"line_number":280,"context_line":"            mocked_execute.assert_called_once_with("},{"line_number":281,"context_line":"                    [\u0027ip\u0027, \u0027netns\u0027, \u0027exec\u0027, \u0027foo\u0027, \u0027find\u0027, \u0027/sys/class/net\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a122d0e_86bf33cf","line":278,"range":{"start_line":278,"start_character":44,"end_line":278,"end_character":48},"updated":"2016-04-27 12:16:23.000000000","message":"Add another test with \u0027return_value \u003d False\u0027 to check that \u0027mocked_execute\u0027 is not called. Otherwise the introduced change in get_devices behaviour is not tested.","commit_id":"0aa6924413e89b90049edb62c827be94b2d816f7"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"001cb12c4742df7926fea0968697d5eb7405cad6","unresolved":false,"context_lines":[{"line_number":273,"context_line":"        fake_str \u003d mock.Mock()"},{"line_number":274,"context_line":"        fake_str.split.return_value \u003d [\u0027lo\u0027]"},{"line_number":275,"context_line":"        mocked_execute.return_value \u003d fake_str"},{"line_number":276,"context_line":"        with mock.patch.object(ip_lib, \u0027IpNetnsCommand\u0027) as ip_ns_cmd:"},{"line_number":277,"context_line":"            ip_ns_cmd.exists.return_value \u003d True"},{"line_number":278,"context_line":"            retval \u003d ip_lib.IPWrapper(namespace\u003d\u0027foo\u0027).get_devices()"},{"line_number":279,"context_line":"            mocked_execute.assert_called_once_with("}],"source_content_type":"text/x-python","patch_set":27,"id":"ba5da102_70cc626a","line":276,"updated":"2016-11-02 15:53:17.000000000","message":"this mock is not needed, no exception is thrown so we don\u0027t check if the namespace exists.","commit_id":"685cc8e9569a5aec399740a06acd6f5c8753ad04"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"90d064543ddaf082a12c046de38202a736a314b4","unresolved":false,"context_lines":[{"line_number":283,"context_line":"        self.assertEqual(retval, [ip_lib.IPDevice(\u0027lo\u0027, namespace\u003d\u0027foo\u0027)])"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    @mock.patch(\u0027neutron.agent.common.utils.execute\u0027)"},{"line_number":286,"context_line":"    def test_get_devices_namespaces_ns_not_exist(self, mocked_execute):"},{"line_number":287,"context_line":"        with mock.patch.object(ip_lib, \u0027IpNetnsCommand\u0027) as ip_ns_cmd:"},{"line_number":288,"context_line":"            ip_ns_cmd.exists.return_value \u003d False"},{"line_number":289,"context_line":"            retval \u003d ip_lib.IPWrapper(namespace\u003d\u0027foo\u0027).get_devices()"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba5da102_0d0bfe2a","line":286,"updated":"2016-11-03 01:37:43.000000000","message":"Don\u0027t you want execute to throw an exception?  Then have the \"exists\" mock return True and False (so two tests) and verify it either returns [] or re-raises?","commit_id":"e029176ec173ba81eb5b02bfd36b6450e00e264e"},{"author":{"_account_id":6788,"name":"Rossella Sblendido","email":"rsblendido@suse.com","username":"rossella-o"},"change_message_id":"299fe30f00f7ea1ca0a5a436a7f38a2d6fc05caa","unresolved":false,"context_lines":[{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    @mock.patch(\u0027neutron.agent.common.utils.execute\u0027)"},{"line_number":286,"context_line":"    def test_get_devices_namespaces_ns_not_exist(self, mocked_execute):"},{"line_number":287,"context_line":"        self.parent._as_root.side_effect \u003d RuntimeError(\u0027Cannot open network namespace\u0027)"},{"line_number":288,"context_line":"        with mock.patch.object(ip_lib, \u0027IpNetnsCommand\u0027) as ip_ns_cmd:"},{"line_number":289,"context_line":"            ip_ns_cmd.exists.return_value \u003d False"},{"line_number":290,"context_line":"            retval \u003d ip_lib.IPWrapper(namespace\u003d\u0027foo\u0027).get_devices()"}],"source_content_type":"text/x-python","patch_set":29,"id":"ba5da102_f75cc81a","line":287,"updated":"2016-11-03 09:53:07.000000000","message":"no need for this line, mocked_execute should have the RuntimeError as side effect","commit_id":"254c501a3f7ebd9f306c72578d4760cbaad5f542"}]}
