summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorafamilyman <afamilymanmailbox@gmail.com>2014-09-19 23:47:52 +0800
committerafamilyman <afamilymanmailbox@gmail.com>2014-09-19 23:47:52 +0800
commit33c25eb871c04dd8f4073521784213616dd3ff80 (patch)
tree631a3d784d232b66eede194102bdc49fc86cbbdb
parentdff8a0c6bcf2cee96475983ce6832089f2320149 (diff)
downloadrtslib-fb-33c25eb871c04dd8f4073521784213616dd3ff80.tar.gz
Update utils.py
Need to add backslash to escape the '-' character in regular expression
-rw-r--r--rtslib/utils.py2
1 files changed, 1 insertions, 1 deletions
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.