mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02: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:
parent
5ec34f65d9
commit
75283983f6
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue