mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-12 11:19:11 -07:00
Catch AttributeError if regex is not found. (#30990)
This commit is contained in:
parent
0f39536c5c
commit
ba99e44b42
1 changed files with 5 additions and 2 deletions
|
@ -166,8 +166,11 @@ def create_apache_identifier(name):
|
||||||
|
|
||||||
for search, reexpr in re_workarounds:
|
for search, reexpr in re_workarounds:
|
||||||
if search in name:
|
if search in name:
|
||||||
rematch = re.search(reexpr, name)
|
try:
|
||||||
return rematch.group(1) + '_module'
|
rematch = re.search(reexpr, name)
|
||||||
|
return rematch.group(1) + '_module'
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
return name + '_module'
|
return name + '_module'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue