From 33c25eb871c04dd8f4073521784213616dd3ff80 Mon Sep 17 00:00:00 2001 From: afamilyman Date: Fri, 19 Sep 2014 23:47:52 +0800 Subject: Update utils.py Need to add backslash to escape the '-' character in regular expression --- rtslib/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtslib/utils.py b/rtslib/utils.py index 180056b..b2e74a8 100644 --- a/rtslib/utils.py +++ b/rtslib/utils.py @@ -128,7 +128,7 @@ def get_blockdev_size(path): 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. -- cgit v1.2.1