)]}'
{"dragonflow/db/drivers/etcd_db_driver.py":[{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"b379c8f47f4e7adbfeb48398460817ef2762d174","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        try:"},{"line_number":154,"context_line":"            prev_value \u003d int(self.get_key(\u0027unique_key\u0027, table))"},{"line_number":155,"context_line":"            # FIXME(lihi): race-condition?"},{"line_number":156,"context_line":"            if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":157,"context_line":"                return prev_value + 1"},{"line_number":158,"context_line":"        except df_exceptions.DBKeyNotFound:"},{"line_number":159,"context_line":"            if prev_value \u003d\u003d 0:"},{"line_number":160,"context_line":"                self.client.put(key, \"1\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_dfb7cff4","line":157,"range":{"start_line":156,"start_character":7,"end_line":157,"end_character":37},"updated":"2017-08-29 18:16:18.000000000","message":"Should be moved out of the try clause, this code does not raise DBKeyNotFound","commit_id":"11faa6f93968c01104cc655bbd957b187c40e87e"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"9083f7edca9212ea9c11ce9c1d0c6ab8e5105e57","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        try:"},{"line_number":154,"context_line":"            prev_value \u003d int(self.get_key(\u0027unique_key\u0027, table))"},{"line_number":155,"context_line":"            # FIXME(lihi): race-condition?"},{"line_number":156,"context_line":"            if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":157,"context_line":"                return prev_value + 1"},{"line_number":158,"context_line":"        except df_exceptions.DBKeyNotFound:"},{"line_number":159,"context_line":"            if prev_value \u003d\u003d 0:"},{"line_number":160,"context_line":"                self.client.put(key, \"1\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"7f287b81_ae1ca577","line":157,"range":{"start_line":156,"start_character":7,"end_line":157,"end_character":37},"in_reply_to":"7f287b81_dfb7cff4","updated":"2017-08-31 06:59:19.000000000","message":"Done","commit_id":"11faa6f93968c01104cc655bbd957b187c40e87e"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"e7d52043b2b6cba1a39919a2034b3bdcc9380e5f","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                self.client.put(key, \"1\")"},{"line_number":160,"context_line":"                return 1"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_d1a4344d","line":162,"updated":"2017-08-31 08:01:24.000000000","message":"nit: \nmaybe change to \n if not self.client .. : \n     raise \n return prev_value +1  \n\nJust for keeping the regular flow outside the if\u0027s ..","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"f1984506f71389cf40bb4454543fc6b16d679892","unresolved":false,"context_lines":[{"line_number":159,"context_line":"                self.client.put(key, \"1\")"},{"line_number":160,"context_line":"                return 1"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_bd3ff6b3","line":162,"in_reply_to":"7f287b81_d1a4344d","updated":"2017-09-04 08:21:40.000000000","message":"I want the default action of this method to be \"raise\" and not return.\nThere are a lot of places to fail, while success occurs only in special cases","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"e7d52043b2b6cba1a39919a2034b3bdcc9380e5f","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                return 1"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def allocate_unique_key(self, table):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_9168ecf4","line":163,"updated":"2017-08-31 08:01:24.000000000","message":"another nit: \n \"prev_value + 1\" calculate twice  maybe store in var?","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"f1984506f71389cf40bb4454543fc6b16d679892","unresolved":false,"context_lines":[{"line_number":160,"context_line":"                return 1"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def allocate_unique_key(self, table):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_3d754699","line":163,"in_reply_to":"7f287b81_9168ecf4","updated":"2017-09-04 08:21:40.000000000","message":"Will change","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"e7d52043b2b6cba1a39919a2034b3bdcc9380e5f","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def allocate_unique_key(self, table):"},{"line_number":167,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_dc520bde","line":164,"updated":"2017-08-31 08:01:24.000000000","message":"maybe it\u0027s better to raise a specific exception for avoiding infinity loop in case that the service is down or something like that?","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":23235,"name":"Lihi Wishnitzer","email":"lihiwish@gmail.com","username":"lihiwish"},"change_message_id":"f1984506f71389cf40bb4454543fc6b16d679892","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def allocate_unique_key(self, table):"},{"line_number":167,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_7d498e5e","line":164,"in_reply_to":"7f287b81_7c0af7d1","updated":"2017-09-04 08:21:40.000000000","message":"Will add specific exception","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"07b80851436b141bfd22e77ef6522183ede96f3b","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        if self.client.replace(key, str(prev_value), str(prev_value + 1)):"},{"line_number":163,"context_line":"            return prev_value + 1"},{"line_number":164,"context_line":"        raise  # Error occured. Restart the allocation"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def allocate_unique_key(self, table):"},{"line_number":167,"context_line":"        while True:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f287b81_7c0af7d1","line":164,"in_reply_to":"7f287b81_dc520bde","updated":"2017-08-31 08:03:55.000000000","message":"I think this will raise the last exception thrown, one stored in sys.exc_info, so, without I\u0027d not recommend doing raise without parameters outside of except clause","commit_id":"08db5e0edf3e252f9833779f8911c6b0a24fba74"}]}
