glance add uploads a double image if using ssl and images is smaller the 4k
Bug #1007093 reported by
Derek Higgins
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Fix Released
|
High
|
Derek Higgins | ||
Essex |
Fix Released
|
High
|
Eoghan Glynn | ||
glance (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned | ||
Quantal |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
If using https and
adding a image smaller then 4096 bytes and
adding a seekable file then
glance add uploads the correct contents twice both concatenated together.
# ls -l testfile
-rw-r--r--. 1 root root 12 May 31 12:09 testfile
# glance -k -v --silent-upload add name="aki-tty" type="kernel" disk_format="aki" container_
Added new image with ID: f0278cf2-
Returned the following metadata for the new image:
<snip/>
<snip/>
Completed in 0.8296 sec.
This bug manifests itself as a progress/status animation that never ends (so I've used --silent-upload in the command above)
Related branches
lp:~openstack-ubuntu-testing/glance/precise-essex-proposed
- Ubuntu Server Developers: Pending requested
-
Diff: 31 lines (+10/-3)2 files modifieddebian/changelog (+6/-0)
debian/glance-common.postinst (+4/-3)
Changed in glance: | |
assignee: | nobody → Derek Higgins (derekh) |
Changed in glance: | |
importance: | Undecided → High |
milestone: | none → folsom-2 |
Changed in glance: | |
status: | Fix Committed → Fix Released |
Changed in nova (Ubuntu Quantal): | |
status: | New → Fix Released |
no longer affects: | nova (Ubuntu) |
no longer affects: | nova (Ubuntu Precise) |
no longer affects: | nova (Ubuntu Quantal) |
Changed in glance (Ubuntu): | |
status: | New → Fix Released |
Changed in glance (Ubuntu Precise): | |
status: | New → Confirmed |
Changed in glance: | |
milestone: | folsom-2 → 2012.2 |
To post a comment you must log in.
it looks like its bad to use a mixture of
file.seek and os.lseek
[derekh@laptop tmp]$ cat t.py
import os
body = open("testfile")
body.seek(0, os.SEEK_END) body.fileno( ), 0, os.SEEK_SET)
body.seek(0)
os.lseek(
print body.read()
[derekh@laptop tmp]$ cat testfile
Hello World
[derekh@laptop tmp]$ python t.py
Hello World
Hello World
this sequence happens in the glance client on the stdin file object in common/ client. py _seekable
glance/client.py - _get_image_size
and
glance/