It seems that some cases in the Image v2 GET /{image_id}/file call don't
appear to be returning the Content-MD5 header at all times, yet our
Image.download method is depending on that header in order to figure out
if the image data is valid to return. Another way to get that value was
mentioned as doing a GET on /{image_id} and looking at the `checksum`
field, which we had already been receiving, but not using directly
because of how the download method works.
We now check for the header first, and if it's not there we make an
additional call to get the image details and find the checksum that way.
If *that* also does not return a checksum, we return the data anyway and
log a warning message that we're not able to verify the integrity of the
returned data.
Reviewed: https:/ /review. openstack. org/367459 /git.openstack. org/cgit/ openstack/ python- openstacksdk/ commit/ ?id=759651f4a9e ae2ba546f466135 50a4cb10ddd964
Committed: https:/
Submitter: Jenkins
Branch: master
commit 759651f4a9eae2b a546f46613550a4 cb10ddd964
Author: Brian Curtin <email address hidden>
Date: Thu Sep 8 11:18:18 2016 -0400
Obtain Image checksum via additional GET
It seems that some cases in the Image v2 GET /{image_id}/file call don't
appear to be returning the Content-MD5 header at all times, yet our
Image.download method is depending on that header in order to figure out
if the image data is valid to return. Another way to get that value was
mentioned as doing a GET on /{image_id} and looking at the `checksum`
field, which we had already been receiving, but not using directly
because of how the download method works.
We now check for the header first, and if it's not there we make an
additional call to get the image details and find the checksum that way.
If *that* also does not return a checksum, we return the data anyway and
log a warning message that we're not able to verify the integrity of the
returned data.
Change-Id: Ied68b7c6ca9415 5ed308911bedd34 f0445c40050
Related-Bug: 1619675