)]}'
{"glance/store/swift.py":[{"author":{"_account_id":1706,"name":"Tom Hancock","email":"tom.hancock@hp.com","username":"tom-hancock"},"change_message_id":"90377553103a8ec2e54a9a09a3b02c81aca6d768","unresolved":false,"context_lines":[{"line_number":334,"context_line":"                        # Delete now stale segments from swift backend"},{"line_number":335,"context_line":"                        for chunk in written_chunks:"},{"line_number":336,"context_line":"                            LOG.debug(_(\"Deleting chunk %s\" % chunk))"},{"line_number":337,"context_line":"                            connection.delete_object(location.container, chunk)"},{"line_number":338,"context_line":"                        raise"},{"line_number":339,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":340,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAN3%2F%2FvO8%3D","line":337,"updated":"2013-03-14 13:40:29.000000000","message":"can connection.delete_object throw an exception, and, if it did, would you want to ignore it and continue?","commit_id":"f39797987c307514162659bbdb80822088d29798"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"57d01a94620546c371497a68b0adbc08f5a761c6","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                            try:"},{"line_number":338,"context_line":"                                connection.delete_object(location.container,"},{"line_number":339,"context_line":"                                                         chunk)"},{"line_number":340,"context_line":"                            except Exception, x:"},{"line_number":341,"context_line":"                                LOG.exception(x)"},{"line_number":342,"context_line":"                        raise(e)"},{"line_number":343,"context_line":"                    bytes_read \u003d reader.bytes_read"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2FtEI%3D","line":340,"updated":"2013-03-15 22:42:41.000000000","message":"Use a 3-letter variable for the exception, and we might as well be forward-compatibile (I think that\u0027s why):\n\n  except Exception as exc:","commit_id":"22af898fe3518c71d122adbe28e263f59c02ab03"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"57d01a94620546c371497a68b0adbc08f5a761c6","unresolved":false,"context_lines":[{"line_number":339,"context_line":"                                                         chunk)"},{"line_number":340,"context_line":"                            except Exception, x:"},{"line_number":341,"context_line":"                                LOG.exception(x)"},{"line_number":342,"context_line":"                        raise(e)"},{"line_number":343,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":344,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""},{"line_number":345,"context_line":"                            \"%(total_chunks)s) of length %(bytes_read)d \""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2FtEM%3D","line":342,"updated":"2013-03-15 22:42:41.000000000","message":"This should just be bare \u0027raise\u0027","commit_id":"22af898fe3518c71d122adbe28e263f59c02ab03"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"5dd51d5467ac175a85ec99b950d0d89fe3c0468b","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                            except Exception as delete_exc:"},{"line_number":345,"context_line":"                                LOG.exception(delete_exc)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"                        # reraise original exception with traceback intact"},{"line_number":348,"context_line":"                        raise exc_type, exc_val, exc_tb"},{"line_number":349,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":350,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2F%2BYA%3D","line":347,"updated":"2013-03-18 20:29:13.000000000","message":"Would try/finally be a simpler way of doing this?\n\n http://doughellmann.com/2009/06/python-exception-handling-techniques.html","commit_id":"bc076dacc5d528f0dcfe8ff8d64c052b2c85fae0"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"903e2d054501d388558d2fac521d6ddf860eb79a","unresolved":false,"context_lines":[{"line_number":344,"context_line":"                            except Exception as delete_exc:"},{"line_number":345,"context_line":"                                LOG.exception(delete_exc)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"                        # reraise original exception with traceback intact"},{"line_number":348,"context_line":"                        raise exc_type, exc_val, exc_tb"},{"line_number":349,"context_line":"                    bytes_read \u003d reader.bytes_read"},{"line_number":350,"context_line":"                    msg \u003d _(\"Wrote chunk %(chunk_name)s (%(chunk_id)d/\""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAOH%2F%2F%2BTw%3D","line":347,"in_reply_to":"AAAAOH%2F%2F%2BYA%3D","updated":"2013-03-18 20:48:03.000000000","message":"I tried that, it seemed better, but it requires an extra switch to make sure you don\u0027t clean up even in the \"success\" case.\n\nWe might be able to make try: finally: work if we put the try block outside of the while loop like this:\n\n  written_chunks \u003d []\n  try:\n      while True:\n          ...\n          written_chunks.append(chunk_name)\n          ...\n      written_chunks \u003d []\n  finally:\n      for chunk in written_chunks:\n          cleanup_chunk(chunk)","commit_id":"bc076dacc5d528f0dcfe8ff8d64c052b2c85fae0"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"fa51c136d5ac0be4dec639fe93b8045e6b2e6f44","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":334,"context_line":"                    except Exception:"},{"line_number":335,"context_line":"                        # Save original traceback"},{"line_number":336,"context_line":"                        exc_type, exc_val, exc_tb \u003d sys.exc_info()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"                        # Delete now stale segments from swift backend"},{"line_number":339,"context_line":"                        for chunk in written_chunks:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F%2BD0%3D","line":336,"updated":"2013-03-18 23:08:55.000000000","message":"Hey,\n\nWhy is this needed instead of using Exception as write_exc and then raise write_exc ?\n\nCheers","commit_id":"8acf394ae92eef5d27b7a22829c316040271d83a"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"e36ae655d502d6c4f6b7042883fe3bfb43fec749","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":334,"context_line":"                    except Exception:"},{"line_number":335,"context_line":"                        # Save original traceback"},{"line_number":336,"context_line":"                        exc_type, exc_val, exc_tb \u003d sys.exc_info()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"                        # Delete now stale segments from swift backend"},{"line_number":339,"context_line":"                        for chunk in written_chunks:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F9ys%3D","line":336,"in_reply_to":"AAAAOH%2F%2F%2BD0%3D","updated":"2013-03-19 04:44:30.000000000","message":"Because it is possible that other exceptions have happened by the time we want to reraise this one, we cannot simply call \"raise\". In addition, if we call \"raise write_exc\" we lose traceback information inside the connection.put_object() call. I always find that very hard to debug, as I no longer know what was going on deeper down to cause the exception.","commit_id":"8acf394ae92eef5d27b7a22829c316040271d83a"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"e22dd2ee928d2c7cb349f83981b8dee3c5ed8ad7","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                        written_chunks.append(chunk_name)"},{"line_number":334,"context_line":"                    except Exception:"},{"line_number":335,"context_line":"                        # Save original traceback"},{"line_number":336,"context_line":"                        exc_type, exc_val, exc_tb \u003d sys.exc_info()"},{"line_number":337,"context_line":""},{"line_number":338,"context_line":"                        # Delete now stale segments from swift backend"},{"line_number":339,"context_line":"                        for chunk in written_chunks:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F9qA%3D","line":336,"in_reply_to":"AAAAOH%2F%2F9ys%3D","updated":"2013-03-19 07:40:01.000000000","message":"mmh, that\u0027s a fair point! Thanks for the clarification! :)","commit_id":"8acf394ae92eef5d27b7a22829c316040271d83a"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"fa51c136d5ac0be4dec639fe93b8045e6b2e6f44","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                connection.delete_object(location.container,"},{"line_number":343,"context_line":"                                                         chunk)"},{"line_number":344,"context_line":"                            except Exception as delete_exc:"},{"line_number":345,"context_line":"                                LOG.exception(delete_exc)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"                        # reraise original exception with traceback intact"},{"line_number":348,"context_line":"                        raise exc_type, exc_val, exc_tb"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F%2BDs%3D","line":345,"updated":"2013-03-18 23:08:55.000000000","message":"Hey,\n\nShould we also warn the user that there could be some \"dirty\" chunks of data in that container?","commit_id":"8acf394ae92eef5d27b7a22829c316040271d83a"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"e36ae655d502d6c4f6b7042883fe3bfb43fec749","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                connection.delete_object(location.container,"},{"line_number":343,"context_line":"                                                         chunk)"},{"line_number":344,"context_line":"                            except Exception as delete_exc:"},{"line_number":345,"context_line":"                                LOG.exception(delete_exc)"},{"line_number":346,"context_line":""},{"line_number":347,"context_line":"                        # reraise original exception with traceback intact"},{"line_number":348,"context_line":"                        raise exc_type, exc_val, exc_tb"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOH%2F%2F9yo%3D","line":345,"in_reply_to":"AAAAOH%2F%2F%2BDs%3D","updated":"2013-03-19 04:44:30.000000000","message":"That\u0027s a good point. I\u0027ll add that.","commit_id":"8acf394ae92eef5d27b7a22829c316040271d83a"},{"author":{"_account_id":455,"name":"Stuart McLaren","email":"stuart.mclaren@hpe.com","username":"stuart-mclaren"},"change_message_id":"c62d32dad1fe1c61fbba250ead1d46c4423bf613","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                connection.delete_object(location.container,"},{"line_number":343,"context_line":"                                                         chunk)"},{"line_number":344,"context_line":"                            except Exception:"},{"line_number":345,"context_line":"                                msg \u003d \"Failed to delete orphaned chunk %s/%s\""},{"line_number":346,"context_line":"                                LOG.exception(msg, location.container, chunk)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"                        # reraise original exception with traceback intact"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOH%2F%2F9Gg%3D","line":345,"updated":"2013-03-19 17:33:43.000000000","message":"Mark, many thanks for running with this. Should we do _() for msg here?","commit_id":"a2a6fb4d9ce2d7505676b6ab933664dd0621e42d"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"1970bbdd1677dc899c30a8d3767fefcb506599a9","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                connection.delete_object(location.container,"},{"line_number":343,"context_line":"                                                         chunk)"},{"line_number":344,"context_line":"                            except Exception:"},{"line_number":345,"context_line":"                                msg \u003d \"Failed to delete orphaned chunk %s/%s\""},{"line_number":346,"context_line":"                                LOG.exception(msg, location.container, chunk)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"                        # reraise original exception with traceback intact"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOH%2F%2F9DI%3D","line":345,"in_reply_to":"AAAAOH%2F%2F9EU%3D","updated":"2013-03-19 17:51:25.000000000","message":"Done","commit_id":"a2a6fb4d9ce2d7505676b6ab933664dd0621e42d"},{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"73f157d44d676d4bbef20f09f234e3b2e360aeb4","unresolved":false,"context_lines":[{"line_number":342,"context_line":"                                connection.delete_object(location.container,"},{"line_number":343,"context_line":"                                                         chunk)"},{"line_number":344,"context_line":"                            except Exception:"},{"line_number":345,"context_line":"                                msg \u003d \"Failed to delete orphaned chunk %s/%s\""},{"line_number":346,"context_line":"                                LOG.exception(msg, location.container, chunk)"},{"line_number":347,"context_line":""},{"line_number":348,"context_line":"                        # reraise original exception with traceback intact"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOH%2F%2F9EU%3D","line":345,"in_reply_to":"AAAAOH%2F%2F9Gg%3D","updated":"2013-03-19 17:47:08.000000000","message":"We should.","commit_id":"a2a6fb4d9ce2d7505676b6ab933664dd0621e42d"}],"glance/tests/functional/store/test_swift.py":[{"author":{"_account_id":1132,"name":"Brian Waldon","email":"brian@waldon.cc","username":"bcwaldon"},"change_message_id":"57d01a94620546c371497a68b0adbc08f5a761c6","unresolved":false,"context_lines":[{"line_number":35,"context_line":""},{"line_number":36,"context_line":"from glance.openstack.common import uuidutils"},{"line_number":37,"context_line":"import glance.store.swift"},{"line_number":38,"context_line":"from glance.common import exception"},{"line_number":39,"context_line":"import glance.common.utils as common_utils"},{"line_number":40,"context_line":"import glance.tests.functional.store as store_tests"},{"line_number":41,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAN3%2F%2FtEE%3D","line":38,"updated":"2013-03-15 22:42:41.000000000","message":"These two imports belong at the top of this block","commit_id":"22af898fe3518c71d122adbe28e263f59c02ab03"}]}
