Description of problem: When interrupting a download, I expect not to get a traceback: [root@ykaul-os-horizon ~(keystone_admin)]$ glance image-download --file /tmp/rhel64-min-b.qcow2 b5379980-341a-454c-a811-5783ab5b9d52 ^C^C^CTraceback (most recent call last): File "/usr/bin/glance", line 9, in <module> load_entry_point('python-glanceclient==0.5.1', 'console_scripts', 'glance')() File "/usr/lib/python2.6/site-packages/glanceclient/shell.py", line 432, in main OpenStackImagesShell().main(sys.argv[1:]) File "/usr/lib/python2.6/site-packages/glanceclient/shell.py", line 403, in main args.func(client, args) File "/usr/lib/python2.6/site-packages/glanceclient/v1/shell.py", line 88, in do_image_download utils.save_image(body, args.file) File "/usr/lib/python2.6/site-packages/glanceclient/common/utils.py", line 150, in save_image image.write(chunk) KeyboardInterrupt Version-Release number of selected component (if applicable): python-glanceclient-0.5.1-1.el6.noarch How reproducible: Steps to Reproduce: 1. Begin download of an image 2. Break (ctrl-c) in the middle. 3. Actual results: Expected results: Additional info:
OK, so this could be made a bit more graceful by catching KeyboardInterrupt so as to avoid the unsightly traceback. However, generally an image download is redirected via stdout to a file. Since this file is under the control of the parent shell, i.e. unknown to the glance CLI, this partial file cannot be cleaned up on interrupt.
I created the upstream bug here: https://bugs.launchpad.net/python-glanceclient/+bug/1130390
An upstream patch is here: https://review.openstack.org/#/c/22359/
Just restating for public viewing that the original fix (Comments 3&4) was moved to earlier in the code, to catch Ctrl-C sooner, by John Bresnahan, and he submitted a new upstream bug and patch: > John Bresnahan: > I submitted this bug upstream: > https://bugs.launchpad.net/python-glanceclient/+bug/1157905 > and this patch: > https://review.openstack.org/#/c/24923/
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-0715.html