mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 16:04:09 -07:00
Fix inventory cache interface (#50446)
* Replace InventoryFileCacheModule with a better developer-interface Use new interface for inventory plugins with backwards compatibility Auto-update the backing cache-plugin if the cache has changed after parsing the inventory plugin * Update CacheModules to use the config system and add a deprecation warning if they are being imported directly rather than using cache_loader * Fix foreman inventory caching * Add tests * Add integration test to check that fact caching works normally with cache plugins using ansible.constants and inventory caching provides a helpful error for non-compatible cache plugins * Add some developer documentation for inventory and cache plugins * Add user documentation for inventory caching * Add deprecation docs * Apply suggestions from docs review * Add changelog
This commit is contained in:
parent
831f068f98
commit
9687879840
24 changed files with 831 additions and 86 deletions
|
@ -21,8 +21,6 @@ __metaclass__ = type
|
|||
|
||||
import os
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
from units.compat import unittest
|
||||
from units.compat.mock import MagicMock, patch
|
||||
from ansible.inventory.manager import InventoryManager
|
||||
|
@ -199,7 +197,6 @@ class TestVariableManager(unittest.TestCase):
|
|||
|
||||
inv1 = InventoryManager(loader=fake_loader, sources=['/etc/ansible/inventory1'])
|
||||
v = VariableManager(inventory=mock_inventory, loader=fake_loader)
|
||||
v._fact_cache = defaultdict(dict)
|
||||
|
||||
play1 = Play.load(dict(
|
||||
hosts=['all'],
|
||||
|
@ -297,7 +294,6 @@ class TestVariableManager(unittest.TestCase):
|
|||
})
|
||||
|
||||
v = VariableManager(loader=fake_loader, inventory=mock_inventory)
|
||||
v._fact_cache = defaultdict(dict)
|
||||
|
||||
play1 = Play.load(dict(
|
||||
hosts=['all'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue