You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/units
Adrian Likins 4025b47629 Fix fact failures cause by ordering of collectors (#30777)
* Fix fact failures cause by ordering of collectors

Some fact collectors need info collected by other facts.
(for ex, service_mgr needs to know 'ansible_system').
This info is passed to the Collector.collect method via
the 'collected_facts' info.

But, the order the fact collectors were running in is
not a set order, so collectors like service_mgr could
run before the PlatformFactCollect ('ansible_system', etc),
so the 'ansible_system' fact would not exist yet.

Depending on the collector and the deps, this can result
in incorrect behavior and wrong or missing facts.

To make the ordering of the collectors more consistent
and predictable, the code that builds that list is now
driven by the order of collectors in default_collectors.py,
and the rest of the code tries to preserve it.

* Flip the loops when building collector names

iterate over the ordered default_collectors list
selecting them for the final list in order instead
of driving it from the unordered collector_names set.

This lets the list returned by select_collector_classes
to stay in the same order as default_collectors.collectors

For collectors that have implicit deps on other fact collectors,
the default collectors can be ordered to include those early.

* default_collectors.py now uses a handful of sub lists of
collectors that can be ordered in default_collectors.collectors.

fixes #30753
fixes #30623

(cherry picked from commit 95abc1d82e)
7 years ago
..
cli Don't ask for password confirm on 'ansible-vault edit' (#30514) 7 years ago
contrib Update vmware_inventory (#26308) 7 years ago
errors test/: PEP8 compliancy (#24803) 8 years ago
executor Ansible Config part2 (#27448) 7 years ago
inventory INI inventory plugin: add documentation about variable types (#25798) 7 years ago
inventory_test_data/group_vars Merge branch 'v2_final' into devel_switch_v2 10 years ago
mock Support multiple vault passwords (#22756) 7 years ago
module_utils Fix fact failures cause by ordering of collectors (#30777) 7 years ago
modules Fix jenkins_plugin test for no net situations (#30568) 7 years ago
parsing Use vault_id when encrypted via vault-edit (#30772) 7 years ago
playbook less confusing 'args' message (#29053) 7 years ago
plugins Fix set theory filters for python3 7 years ago
template template: fix KeyError: 'undefined variable: 0 (#27972) 7 years ago
utils test/: PEP8 compliancy (#24803) 8 years ago
vars make groups magic var dependant on inventory (#28677) 7 years ago
__init__.py Add empty-init code-smell script. (#18406) 8 years ago
conftest.py Fix bugs in ansible-test units command. (#24044) 8 years ago
test_constants.py 1st part of ansible config, adds ansible-config to view/manage configs (#12797) 8 years ago