Optimizes using fnmatch only if needed
Skips fnmatch'ing if there is only a '*' in filter.
This commit is contained in:
parent
d80e78a9ae
commit
981add2561
1 changed files with 1 additions and 1 deletions
2
setup
2
setup
|
@ -1140,7 +1140,7 @@ def run_setup(module):
|
|||
setup_result = { 'ansible_facts': {} }
|
||||
|
||||
for (k,v) in setup_options.items():
|
||||
if fnmatch.fnmatch(k, module.params['filter']):
|
||||
if module.params['filter'] == '*' or fnmatch.fnmatch(k, module.params['filter']):
|
||||
setup_result['ansible_facts'][k] = v
|
||||
|
||||
# hack to keep --verbose from showing all the setup module results
|
||||
|
|
Loading…
Reference in a new issue