Comment 20 for bug 1619675

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to python-openstacksdk (master)

Reviewed: https://review.openstack.org/367459
Committed: https://git.openstack.org/cgit/openstack/python-openstacksdk/commit/?id=759651f4a9eae2ba546f46613550a4cb10ddd964
Submitter: Jenkins
Branch: master

commit 759651f4a9eae2ba546f46613550a4cb10ddd964
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: Ied68b7c6ca94155ed308911bedd34f0445c40050
    Related-Bug: 1619675