diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2021-03-19 13:18:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-19 13:18:31 -0400 |
commit | 089d0a0508a470799d099d95fc371e66756a00b3 (patch) | |
tree | f9bb0ebcd1312716b73acccc600e5c14296de2f9 /changelogs/fragments | |
parent | 48c0fbd1cb92943b992b8a522e40ae6fe668e648 (diff) | |
download | ansible-089d0a0508a470799d099d95fc371e66756a00b3.tar.gz |
find - set proper default based on use_regex (#73961)
When using "use_regex: yes" and setting an excludes: without
specifying a pattern: the existing code passes the file-glob '*' to
the regex matcher. This results in an internal invalid-regex
exception being thrown.
This maintains the old semantics of a default match-all for pattern:
but switches the default to '.*' when use_regex is specified.
The code made sense as-is before excludes: was added (2.5). In that
case, it made no sense to set use_regex but *not* set a pattern.
However, with excludes: it now makes sense to only want to exclude a
given regex but not specify a specific matching pattern.
Closes: #50067
* moved change to new location
added changelog
* Update lib/ansible/modules/find.py
Co-authored-by: Ian Wienand <iwienand@redhat.com>
Diffstat (limited to 'changelogs/fragments')
-rw-r--r-- | changelogs/fragments/fix_find_default.yml | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/changelogs/fragments/fix_find_default.yml b/changelogs/fragments/fix_find_default.yml new file mode 100644 index 0000000000..85c640ae95 --- /dev/null +++ b/changelogs/fragments/fix_find_default.yml @@ -0,0 +1,2 @@ +bugfixes: + - find module, fix default pattern when use_regex is true. |