]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Sync latest Oslo code for imageutils
authorAndrew Kerr <andrew.kerr@netapp.com>
Thu, 13 Mar 2014 19:01:27 +0000 (15:01 -0400)
committerAndrew Kerr <andrew.kerr@netapp.com>
Thu, 13 Mar 2014 19:13:09 +0000 (15:13 -0400)
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

cinder/openstack/common/imageutils.py

index babffceec457098cd698659d49e23a8daaba59b8..e8a19e244bb504d6083d76a0132fc8ef375545ee 100644 (file)
@@ -29,7 +29,8 @@ class QemuImgInfo(object):
     BACKING_FILE_RE = re.compile((r"^(.*?)\s*\(actual\s+path\s*:"
                                   r"\s+(.*?)\)\s*$"), re.I)
     TOP_LEVEL_RE = re.compile(r"^([\w\d\s\_\-]+):(.*)$")
-    SIZE_RE = re.compile(r"(\d+)(\w+)?(\s*\(\s*(\d+)\s+bytes\s*\))?", re.I)
+    SIZE_RE = re.compile(r"(\d*\.?\d+)(\w+)?(\s*\(\s*(\d+)\s+bytes\s*\))?",
+                         re.I)
 
     def __init__(self, cmd_output=None):
         details = self._parse(cmd_output or '')