Activity log for bug #1050345

Date Who What changed Old value New value Message
2012-09-13 10:44:06 Alessandro Pilotti bug added bug
2012-09-13 10:44:15 Alessandro Pilotti python-glanceclient: assignee Alessandro Pilotti (alexpilotti)
2012-09-13 10:57:44 Alessandro Pilotti summary glance add / image-create doesn't work on Windows glance add / update / image-create / image-update don't work on Windows
2012-09-13 10:58:37 Alessandro Pilotti description By trying to add an image to Glance on Windows with: glance image-create --name="Image name" --container-format ovf --disk-format qcow2 --file image.img or glance image-create --name="Image name" --container-format ovf --disk-format qcow2 < image.img the upload will hang if the file contains a byte with value 0x1A (EOF), due to the fact that the file and stdin streams are treated as text and not binary streams. The same issue applies to the equivalent deprecated "glance add" command. The fix consists in setting the streams in binary mode in both cases: File: python-glanceclient\glanceclient\v1\shell.py if 'location' not in fields and 'copy_from' not in fields: if args.file: fields['data'] = open(args.file, 'rb') else: if os.name == 'nt': msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY) fields['data'] = sys.stdin By trying to add an image to Glance on Windows with: glance image-create --name="Image name" --container-format ovf --disk-format qcow2 --file image.img or glance image-create --name="Image name" --container-format ovf --disk-format qcow2 < image.img the upload will hang if the file contains a byte with value 0x1A (EOF), due to the fact that the file and stdin streams are treated as text and not binary streams. The same issue applies to "image-update" and the equivalent deprecated "add" and "update" commands. The fix consists in setting the streams in binary mode in both cases: File: python-glanceclient\glanceclient\v1\shell.py     if 'location' not in fields and 'copy_from' not in fields:         if args.file:             fields['data'] = open(args.file, 'rb')         else:             if os.name == 'nt':                 msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)             fields['data'] = sys.stdin
2012-09-13 11:07:40 OpenStack Infra python-glanceclient: status New In Progress
2012-09-13 11:15:41 Alessandro Pilotti python-glanceclient: status In Progress Fix Committed
2012-09-13 11:20:18 OpenStack Infra python-glanceclient: status Fix Committed In Progress
2012-09-13 15:13:48 Brian Waldon python-glanceclient: importance Undecided High
2012-09-13 15:25:30 Brian Waldon python-glanceclient: milestone v0.6.0
2012-09-18 20:45:00 OpenStack Infra python-glanceclient: status In Progress Fix Committed
2012-11-20 05:44:56 Brian Waldon python-glanceclient: status Fix Committed Fix Released