SIZE_RE regex is incorrect for returned string

Bug #1285764 reported by Andrew Kerr
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Andrew Kerr
oslo-incubator
Fix Released
Undecided
Andrew Kerr

Bug Description

imageutils.py line 32 has an incorrect regex:

SIZE_RE = re.compile(r"(\d+)(\w+)?(\s*\(\s*(\d+)\s+bytes\s*\))?", re.I)

This will not properly parse the result of 'qemu-img info' line:

virtual size: 2.0G (2147483648 bytes)

This results in the returned size of the image not being in Bytes. The correct regex should be:

SIZE_RE = re.compile(r"(\d+\.?\d*)(\w+)?(\s*\(\s*(\d+)\s+bytes\s*\))?", re.I)

Tags: nfs
Changed in oslo:
assignee: nobody → Andrew Kerr (andrew-kerr)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to oslo-incubator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/76912

description: updated
tags: added: nfs
description: updated
Revision history for this message
Andrew Kerr (andrew-kerr) wrote :
Eric Harney (eharney)
Changed in cinder:
milestone: none → icehouse-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

Fix proposed to branch: master
Review: https://review.openstack.org/78874

Changed in cinder:
assignee: nobody → Daniel Gollub (d-gollub)
status: New → In Progress
Changed in oslo:
status: In Progress → Fix Committed
Changed in cinder:
assignee: Daniel Gollub (d-gollub) → Andrew Kerr (andrew-kerr)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/78874
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=dcfeac2b1e57a4f185c881201fccfca27c5eb723
Submitter: Jenkins
Branch: master

commit dcfeac2b1e57a4f185c881201fccfca27c5eb723
Author: Andrew Kerr <email address hidden>
Date: Thu Mar 13 15:01:27 2014 -0400

    Sync latest Oslo code for imageutils

    This sync pulls the latest Oslo imageutils code over to cinder
    to fix QemuImgInfo parsing needed by NFS drivers.

    -> b455fac Enable decimal value input in imageutils.QemuImgInfo
    --> cinder/openstack/common/imageutils.py

    Oslo version:
    -> 0e98afd Re-raise exception of unloadable library
    -> Date: Tue Mar 4 17:26:40 2014 +0100

    Change-Id: I770b0f534c6949c2ff6995a03923a21ed26e04da
    Closes-Bug: 1285764

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in oslo:
milestone: icehouse-rc1 → 2014.1
Thierry Carrez (ttx)
Changed in cinder:
milestone: icehouse-rc1 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.