summaryrefslogtreecommitdiff
path: root/rtslib/utils.py
diff options
context:
space:
mode:
authorAndy Grover <agrover@redhat.com>2015-11-06 09:13:35 -0800
committerAndy Grover <agrover@redhat.com>2015-11-06 09:13:35 -0800
commit290738c20213a9fabff1d0a0d8eb726706473aad (patch)
tree1342c651886f48c2e3eb6df4043bc97f95d29c88 /rtslib/utils.py
parent3cddf352d5cf0f23e2b7ead601050367eda2d237 (diff)
downloadrtslib-fb-290738c20213a9fabff1d0a0d8eb726706473aad.tar.gz
Fix regex in get_size_for_disk_name
Would break with 'sda10'. We need to non-greedily match the first subgroup. Signed-off-by: Andy Grover <agrover@redhat.com>
Diffstat (limited to 'rtslib/utils.py')
-rw-r--r--rtslib/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/rtslib/utils.py b/rtslib/utils.py
index 5531e8f..79a4d9d 100644
--- a/rtslib/utils.py
+++ b/rtslib/utils.py
@@ -152,7 +152,7 @@ def get_size_for_disk_name(name):
return get_size("/sys/block/%s" % name)
except IOError:
# Maybe it's a partition?
- m = re.search(r'^([a-z0-9_\-!]+)(\d+)$', name)
+ m = re.search(r'^([a-z0-9_\-!]+?)(\d+)$', name)
if m:
# If disk name ends with a digit, Linux sticks a 'p' between it and
# the partition number in the blockdev name.