OpenStack Image Registry and Delivery Service (Glance)

glance checked_iter missing variable in error case, mixed type of expected_size

Reported by Tom Hancock on 2011-11-03
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Medium
Tom Hancock

Bug Description

Two issues wrt checked_iter() function in api/v1/images.py

The error message raised by IOError needs %locals() added to it

If there is no cache in the pipeline image_meta['size'] appears to be of type str on my system. Thus the compare of expected_size and bytes_written always failed even when the values should have matched.
Unconditionally converting expected_size to int is one way to temporarily resolve this.
Curiously image_meta['size'] is of type int if the cache is in the pipeline.

Jay Pipes (jaypipes) on 2011-11-03
Changed in glance:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Tom Hancock (tom-hancock)
milestone: none → essex-1

Reviewed: https://review.openstack.org/1289
Committed: http://github.com/openstack/glance/commit/2674e8bbbcd340d2161c08d272b57acd18684eb8
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 2674e8bbbcd340d2161c08d272b57acd18684eb8
Author: Tomas Hancock <email address hidden>
Date: Thu Nov 3 12:07:34 2011 +0000

    Fix LP Bug#885696 two issues with checked_iter

     The error message raised by IOError needed %locals() added

     If there is no cache in the pipeline image_meta['size'] appears to be of
     type str on my system. Thus the compare of expected_size and bytes_written
     always failed even when the values should have matched.
     Unconditionally convert expected_size to int to resolve this.
     Curiously image_meta['size'] is of type int if the cache is in the pipeline.
     This latter fix could be removed if the typing is resolved

    Change-Id: I05eadce2b5ceb8eb7939acb41668aff089270e21

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2011-11-17
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-04-05
Changed in glance:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers