mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-06 18:53:12 +00:00
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
This commit is contained in:
@@ -615,7 +615,7 @@ class LinuxHardware(Hardware):
|
||||
|
||||
d['partitions'] = {}
|
||||
for folder in os.listdir(sysdir):
|
||||
m = re.search("(" + diskname + r"[p]*\d+)", folder)
|
||||
m = re.search("(" + diskname + r"[p]?\d+)", folder)
|
||||
if m:
|
||||
part = {}
|
||||
partname = m.group(1)
|
||||
|
||||
Reference in New Issue
Block a user