)]}'
{"neutron/agent/linux/ip_lib.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9536c9c83e79659c77e9e5d1574122524553b28d","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        try:"},{"line_number":568,"context_line":"            self._as_root([ip_version], tuple(args))"},{"line_number":569,"context_line":"        except RuntimeError as rte:"},{"line_number":570,"context_line":"            with (excutils.save_and_reraise_exception()) as ctx:"},{"line_number":571,"context_line":"                if \"Cannot find device\" in str(rte):"},{"line_number":572,"context_line":"                    ctx.reraise \u003d False"},{"line_number":573,"context_line":"                    raise exceptions.DeviceNotFoundError("}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_eff438d0","line":570,"updated":"2015-09-02 20:58:03.000000000","message":"I\u0027ll replace this one too.  It is effectively the same thing.  Good catch.","commit_id":"03f71777d7b3dd02a0af77d4c7a418ef123e5791"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"a9e8b537223af1acc074ce1f7407d1c5dbc08e5e","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":705,"context_line":"        for k, v in kwargs.items():"},{"line_number":706,"context_line":"            args +\u003d [k, v]"},{"line_number":707,"context_line":"        try:"},{"line_number":708,"context_line":"            self._as_root([ip_version], tuple(args))"},{"line_number":709,"context_line":"        except RuntimeError as rte:"},{"line_number":710,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_c94ac627","line":707,"updated":"2015-09-01 22:45:16.000000000","message":"We probably should add a \n\ndef _route_cmd_helper(self, ip_version, args\u003dNone) and then copy 708-714 which would allow us to remove the duplicated code between these methods. \n\nWe could also add another helper method to remove the duplicated code above which only differs on one line but you can ignore that if you want.","commit_id":"03f71777d7b3dd02a0af77d4c7a418ef123e5791"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9536c9c83e79659c77e9e5d1574122524553b28d","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":705,"context_line":"        for k, v in kwargs.items():"},{"line_number":706,"context_line":"            args +\u003d [k, v]"},{"line_number":707,"context_line":"        try:"},{"line_number":708,"context_line":"            self._as_root([ip_version], tuple(args))"},{"line_number":709,"context_line":"        except RuntimeError as rte:"},{"line_number":710,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"}],"source_content_type":"text/x-python","patch_set":4,"id":"da20952f_8f6c9c9d","line":707,"in_reply_to":"da20952f_c94ac627","updated":"2015-09-02 20:58:03.000000000","message":"Fair enough.  Done.","commit_id":"03f71777d7b3dd02a0af77d4c7a418ef123e5791"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"2126539d5a0ffd660573417deb394e0352678560","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            args +\u003d [\u0027metric\u0027, metric]"},{"line_number":557,"context_line":"        args +\u003d self._dev_args()"},{"line_number":558,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":559,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def _as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":562,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_793a089a","line":559,"updated":"2015-09-03 18:03:31.000000000","message":"You want to change here too?","commit_id":"66ea2848ed04e0bc5341c1fa57c60f1e1ba69b07"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"fb21632aad4a14e105126d1655ce45c82ec5ee8c","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            args +\u003d [\u0027metric\u0027, metric]"},{"line_number":557,"context_line":"        args +\u003d self._dev_args()"},{"line_number":558,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":559,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":560,"context_line":""},{"line_number":561,"context_line":"    def _as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":562,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_157bbef5","line":559,"in_reply_to":"da20952f_793a089a","updated":"2015-09-09 21:22:34.000000000","message":"I thought about taking it further but didn\u0027t.  I knew I needed to change add_route and delete_route and was comfortable that all of the callers would handle it correctly.  To go further, I\u0027ll want to look at the callers of those methods to see if the change in exception behavior will be handled gracefully.\n\nI\u0027ll it out there for other reviewers to weigh in.","commit_id":"66ea2848ed04e0bc5341c1fa57c60f1e1ba69b07"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"2126539d5a0ffd660573417deb394e0352678560","unresolved":false,"context_lines":[{"line_number":683,"context_line":"                else:"},{"line_number":684,"context_line":"                    break"},{"line_number":685,"context_line":""},{"line_number":686,"context_line":"            for (device, src) in device_list:"},{"line_number":687,"context_line":"                self._as_root(options, (\u0027del\u0027, subnet, \u0027dev\u0027, device))"},{"line_number":688,"context_line":"                if (src !\u003d \u0027\u0027):"},{"line_number":689,"context_line":"                    self._as_root(options,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_996cbc9d","line":686,"updated":"2015-09-03 18:03:31.000000000","message":"ditto?","commit_id":"66ea2848ed04e0bc5341c1fa57c60f1e1ba69b07"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"2126539d5a0ffd660573417deb394e0352678560","unresolved":false,"context_lines":[{"line_number":685,"context_line":""},{"line_number":686,"context_line":"            for (device, src) in device_list:"},{"line_number":687,"context_line":"                self._as_root(options, (\u0027del\u0027, subnet, \u0027dev\u0027, device))"},{"line_number":688,"context_line":"                if (src !\u003d \u0027\u0027):"},{"line_number":689,"context_line":"                    self._as_root(options,"},{"line_number":690,"context_line":"                                  (\u0027append\u0027, subnet,"},{"line_number":691,"context_line":"                                   \u0027proto\u0027, \u0027kernel\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_b96740b6","line":688,"updated":"2015-09-03 18:03:31.000000000","message":"ditto?","commit_id":"66ea2848ed04e0bc5341c1fa57c60f1e1ba69b07"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"2126539d5a0ffd660573417deb394e0352678560","unresolved":false,"context_lines":[{"line_number":691,"context_line":"                                   \u0027proto\u0027, \u0027kernel\u0027,"},{"line_number":692,"context_line":"                                   \u0027src\u0027, src,"},{"line_number":693,"context_line":"                                   \u0027dev\u0027, device))"},{"line_number":694,"context_line":"                else:"},{"line_number":695,"context_line":"                    self._as_root(options,"},{"line_number":696,"context_line":"                                  (\u0027append\u0027, subnet,"},{"line_number":697,"context_line":"                                   \u0027proto\u0027, \u0027kernel\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"da20952f_190f4ce2","line":694,"updated":"2015-09-03 18:03:31.000000000","message":"ditto?","commit_id":"66ea2848ed04e0bc5341c1fa57c60f1e1ba69b07"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"dcd4703278bf5c4fa329e9b626b37e031469e3d9","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_0a7019a3","line":586,"updated":"2015-09-24 01:19:40.000000000","message":"wish to change it into: _run_as_root_detect_device_not_found,  verb object phrase is better.","commit_id":"89d5b6adbcd850beb81e33e1ed0a9f7b478fc4d7"},{"author":{"_account_id":14615,"name":"Sergey Belous","email":"belous.py@gmail.com","username":"sbelous"},"change_message_id":"f8c9f7d12f165b5368230b0388a899fb68e550af","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_67c22355","line":586,"in_reply_to":"ba15a1d1_0a7019a3","updated":"2015-09-24 08:27:32.000000000","message":"+","commit_id":"89d5b6adbcd850beb81e33e1ed0a9f7b478fc4d7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fd3cb0fd28dec4c0ce02750c24bb763dd72cf48","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_6fd86c1e","line":586,"in_reply_to":"ba15a1d1_67c22355","updated":"2015-09-24 18:01:44.000000000","message":"Done","commit_id":"89d5b6adbcd850beb81e33e1ed0a9f7b478fc4d7"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"e8dd45a0a8ea7a2352479c496be20736ac094577","unresolved":false,"context_lines":[{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"},{"line_number":590,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"},{"line_number":591,"context_line":"                if \"Cannot find device\" in str(rte):"},{"line_number":592,"context_line":"                    ctx.reraise \u003d False"},{"line_number":593,"context_line":"                    raise exceptions.DeviceNotFoundError(device_name\u003dself.name)"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba15a1d1_e5cdd630","line":591,"updated":"2015-09-24 02:30:54.000000000","message":"I know it was copied from below, but I\u0027m always torn on checking the error string, or using something like device_exists() here:\n\n    if self.name and not device_exists(device_name\u003dself.name,\n                                            namespace\u003dself._parent.namespace):\n\nMore of a programmatic way than parsing the error string, but it has more overhead and is probably overkill.  And it would require even more mocking in the tests :(","commit_id":"89d5b6adbcd850beb81e33e1ed0a9f7b478fc4d7"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2fd3cb0fd28dec4c0ce02750c24bb763dd72cf48","unresolved":false,"context_lines":[{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"},{"line_number":590,"context_line":"            with excutils.save_and_reraise_exception() as ctx:"},{"line_number":591,"context_line":"                if \"Cannot find device\" in str(rte):"},{"line_number":592,"context_line":"                    ctx.reraise \u003d False"},{"line_number":593,"context_line":"                    raise exceptions.DeviceNotFoundError(device_name\u003dself.name)"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a1a9d01_0fdd3014","line":591,"in_reply_to":"ba15a1d1_e5cdd630","updated":"2015-09-24 18:01:44.000000000","message":"It takes two calls and could be racy.  I know checking the error string isn\u0027t ideal but I do like the \"try and ask for forgiveness if it fails\" pattern better.","commit_id":"89d5b6adbcd850beb81e33e1ed0a9f7b478fc4d7"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"1ee9360ee5e81e107ba96048d9feb5b1a9faff2e","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _run_as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_2fccb434","line":586,"updated":"2015-09-24 18:05:12.000000000","message":"does this really need to specify that its running as root? are there cases where this would be needed to run as another user? if so I think just naming it detect_device_not_found works for both cases.  If users other than root can be used default an argument to run as root.\n\nits bike shedding at this point so just a nit.  it works for me either way.","commit_id":"606e346b803101345a991b6183ee16201222984a"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c9dffd9fae0021907a5bf7bf7c3b618c22a888a1","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _run_as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_32a40f56","line":586,"in_reply_to":"9a1a9d01_2fccb434","updated":"2015-09-24 23:04:45.000000000","message":"+1, _run_as_root_detect_device_not_found focuses more on the how it does it than on the what it does (_detect_device_not_found)","commit_id":"606e346b803101345a991b6183ee16201222984a"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"f7446f6e7ffc669482595a0807437588ca60ab32","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        args +\u003d self._table_args(table)"},{"line_number":584,"context_line":"        self._as_root([ip_version], tuple(args))"},{"line_number":585,"context_line":""},{"line_number":586,"context_line":"    def _run_as_root_detect_device_not_found(self, *args, **kwargs):"},{"line_number":587,"context_line":"        try:"},{"line_number":588,"context_line":"            return self._as_root(*args, **kwargs)"},{"line_number":589,"context_line":"        except RuntimeError as rte:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a1a9d01_c85e4445","line":586,"in_reply_to":"9a1a9d01_32a40f56","updated":"2015-09-25 00:19:27.000000000","message":"I think using _run to mean it is running a command, the main flow of this function is not to detect device not found, which is just side effect.\nmaybe _run_as_root_with_device_not_found_detection(xxx) is better.","commit_id":"606e346b803101345a991b6183ee16201222984a"}]}
