Simplify regex filter code (#50202)

This was written when we were redefining `bool` in the same module. As
we aren't doing this any longer, simplify it back to just calling
`bool()`.
pull/51674/head
Jim Rollenhagen 5 years ago committed by ansibot
parent 89a1c68f98
commit 07605923e1

@ -120,8 +120,7 @@ def regex(value='', pattern='', ignorecase=False, multiline=False, match_type='s
if multiline:
flags |= re.M
_re = re.compile(pattern, flags=flags)
_bool = __builtins__.get('bool')
return _bool(getattr(_re, match_type, 'search')(value))
return bool(getattr(_re, match_type, 'search')(value))
def match(value, pattern='', ignorecase=False, multiline=False):

Loading…
Cancel
Save