Catch AttributeError if regex is not found. (#30990)

This commit is contained in:
n0trax 2017-10-01 13:19:34 +02:00 committed by ansibot
parent 0f39536c5c
commit ba99e44b42

View file

@ -166,8 +166,11 @@ def create_apache_identifier(name):
for search, reexpr in re_workarounds:
if search in name:
rematch = re.search(reexpr, name)
return rematch.group(1) + '_module'
try:
rematch = re.search(reexpr, name)
return rematch.group(1) + '_module'
except AttributeError:
pass
return name + '_module'