[master 1/1] Fix an overly inclusive regex in DeviceTree.resolveDevice.
dwlehman
installerbot-noreply at redhat.com
Thu Oct 8 20:49:57 UTC 2015
From: David Lehman <dlehman at redhat.com>
Fixes #152
---
blivet/devicetree.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 274fc0d..cf74edd 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -932,12 +932,13 @@ def resolveDevice(self, devspec, blkidTab=None, cryptTab=None, options=None):
(label.startswith("'") and label.endswith("'"))):
label = label[1:-1]
device = self.labels.get(label)
- elif re.match(r'(0x)?[A-Za-z0-9]{2}(p\d+)?$', devspec):
+ elif re.match(r'(0x)?[A-Fa-f0-9]{2}(p\d+)?$', devspec):
# BIOS drive number
- spec = int(devspec, 16)
+ (drive, _p, partnum) = devspec.partition("p")
+ spec = int(drive, 16)
for (edd_name, edd_number) in edd.edd_dict.items():
if edd_number == spec:
- device = self.getDeviceByName(edd_name)
+ device = self.getDeviceByName(edd_name + partnum)
break
elif options and "nodev" in options.split(","):
device = self.getDeviceByName(devspec)
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/9b936aa795d35dc7323fd0a0764eb56fd18b15e9
More information about the anaconda-patches
mailing list