)]}'
{"nova/image/glance.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4db003555c4d576489c80503b1d8aace831974c","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                for chunk in image_chunks:"},{"line_number":368,"context_line":"                    try:"},{"line_number":369,"context_line":"                        if not exc:"},{"line_number":370,"context_line":"                            data.write(chunk)"},{"line_number":371,"context_line":"                    except IOError as exc:"},{"line_number":372,"context_line":"                        pass"},{"line_number":373,"context_line":"            finally:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_0865f5df","line":370,"updated":"2015-06-03 21:26:00.000000000","message":"Write a simple unit test such that data is a mock called twice because len(image_chunks) \u003d\u003d 2 and on the first call to write() it raises the IOError but we assert that data.write() is called twice, and the method raises the caught IOError.","commit_id":"945d72c6181a2cf808de9f9401b93c28f15b3a59"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"991200e646ac7857fd4749a6719ea56719c3b734","unresolved":false,"context_lines":[{"line_number":367,"context_line":"                for chunk in image_chunks:"},{"line_number":368,"context_line":"                    try:"},{"line_number":369,"context_line":"                        if not exc:"},{"line_number":370,"context_line":"                            data.write(chunk)"},{"line_number":371,"context_line":"                    except IOError as exc:"},{"line_number":372,"context_line":"                        pass"},{"line_number":373,"context_line":"            finally:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_2860b100","line":370,"in_reply_to":"5afe65bd_0865f5df","updated":"2015-06-03 22:15:04.000000000","message":"A unit test should be doable.  I think data.write() will only be called once though.","commit_id":"945d72c6181a2cf808de9f9401b93c28f15b3a59"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a4db003555c4d576489c80503b1d8aace831974c","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                        if not exc:"},{"line_number":370,"context_line":"                            data.write(chunk)"},{"line_number":371,"context_line":"                    except IOError as exc:"},{"line_number":372,"context_line":"                        pass"},{"line_number":373,"context_line":"            finally:"},{"line_number":374,"context_line":"                if close_file:"},{"line_number":375,"context_line":"                    data.close()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_c8b59d31","line":372,"updated":"2015-06-03 21:26:00.000000000","message":"I\u0027m not very familiar with this but couldn\u0027t you raise StopIteration() here?\n\nhttps://docs.python.org/2/library/exceptions.html#exceptions.StopIteration","commit_id":"945d72c6181a2cf808de9f9401b93c28f15b3a59"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"656a463157b235703cbfecfcd7f275ccd00ac6a6","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                        if not exc:"},{"line_number":370,"context_line":"                            data.write(chunk)"},{"line_number":371,"context_line":"                    except IOError as exc:"},{"line_number":372,"context_line":"                        pass"},{"line_number":373,"context_line":"            finally:"},{"line_number":374,"context_line":"                if close_file:"},{"line_number":375,"context_line":"                    data.close()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_b32bf693","line":372,"in_reply_to":"5afe65bd_a84b8186","updated":"2015-06-03 22:37:20.000000000","message":"After poking around I *think* the code that actually handles the file closing is in glance_store._drivers.filesystem.ChunkedFile.__iter__() or equivalent.\n\nnova calls into glance via the glanceclient, which does a REST API call to glance, so I doubt that raising StopIteration() in here would actually propagate over to glance.\n\nI don\u0027t see a glance API to abort an in-progress read of an image, so I think we have to read the whole image even if we can\u0027t do anything with it.","commit_id":"945d72c6181a2cf808de9f9401b93c28f15b3a59"},{"author":{"_account_id":8768,"name":"Chris Friesen","email":"chris.friesen@windriver.com","username":"cbf123"},"change_message_id":"991200e646ac7857fd4749a6719ea56719c3b734","unresolved":false,"context_lines":[{"line_number":369,"context_line":"                        if not exc:"},{"line_number":370,"context_line":"                            data.write(chunk)"},{"line_number":371,"context_line":"                    except IOError as exc:"},{"line_number":372,"context_line":"                        pass"},{"line_number":373,"context_line":"            finally:"},{"line_number":374,"context_line":"                if close_file:"},{"line_number":375,"context_line":"                    data.close()"}],"source_content_type":"text/x-python","patch_set":1,"id":"5afe65bd_a84b8186","line":372,"in_reply_to":"5afe65bd_c8b59d31","updated":"2015-06-03 22:15:04.000000000","message":"I\u0027m not very familiar with the code either, to be honest.  I\u0027m hoping that someone with more knowledge will pipe up.","commit_id":"945d72c6181a2cf808de9f9401b93c28f15b3a59"}]}
