From: Andrew Kerr Date: Thu, 13 Mar 2014 19:01:27 +0000 (-0400) Subject: Sync latest Oslo code for imageutils X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=dcfeac2b1e57a4f185c881201fccfca27c5eb723;p=openstack-build%2Fcinder-build.git 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 --- diff --git a/cinder/openstack/common/imageutils.py b/cinder/openstack/common/imageutils.py index babffceec..e8a19e244 100644 --- a/cinder/openstack/common/imageutils.py +++ b/cinder/openstack/common/imageutils.py @@ -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 '')