Read response to reset HTTPConnection state machine

This commit is contained in:
Rick Harris
2011-08-05 00:12:19 +00:00
parent 0fea610a69
commit 66916be1ad
@@ -261,6 +261,9 @@ def _upload_tarball(staging_path, image_id, glance_host, glance_port, os_type,
if header.lower().startswith("x-image-meta-property-"):
headers[header.lower()] = value
# Toss body so connection state-machine is ready for next request/response
resp.read()
# NOTE(sirp): httplib under python2.4 won't accept a file-like object
# to request
conn.putrequest('PUT', '/v1/images/%s' % image_id)