1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/units/module_utils
Adrian Likins 95abc1d82e Fix fact failures cause by ordering of collectors ()
* 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 
fixes 
2017-09-28 10:36:22 -04:00
..
aws
basic
cloud [cloud] Add more configurable backoff implementations to CloudRetry/AWSRetry () 2017-08-08 08:56:46 -04:00
ec2 AWSRetry: allow retrying on additional ClientError exceptions () 2017-08-22 15:31:20 -04:00
facts Fix fact failures cause by ordering of collectors () 2017-09-28 10:36:22 -04:00
gcp Fix dangerous default args. () 2017-09-12 00:11:13 -07:00
json_utils Enable more pylint rules and fix reported issues. () 2017-09-18 23:20:32 -07:00
parsing
__init__.py
test_aci.py Clean up ACI error text () 2017-09-18 11:51:58 -07:00
test_basic.py Fix fallback and boolean check in argspec () 2017-08-10 12:10:18 -07:00
test_database.py
test_distribution_version.py Fix 'distribution' fact for ArchLinux () 2017-09-25 15:00:31 -04:00
test_known_hosts.py
test_network_common.py
test_postgresql.py
test_text.py