Use a more exact regex (#39811)

The pattern we're matching can have zero or one p.  Be more careful to
match exactly that.

Slight revision of #39730
pull/39814/head
Toshio Kuratomi 7 years ago committed by GitHub
parent 5ec34f65d9
commit 75283983f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -615,7 +615,7 @@ class LinuxHardware(Hardware):
d['partitions'] = {} d['partitions'] = {}
for folder in os.listdir(sysdir): for folder in os.listdir(sysdir):
m = re.search("(" + diskname + r"[p]*\d+)", folder) m = re.search("(" + diskname + r"[p]?\d+)", folder)
if m: if m:
part = {} part = {}
partname = m.group(1) partname = m.group(1)

Loading…
Cancel
Save