mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-30 14:21:26 -07:00
Update inventory caching to remove deprecation warnings (#53976)
This commit is contained in:
parent
1a5732807f
commit
a93154c57f
6 changed files with 19 additions and 14 deletions
|
@ -583,7 +583,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
cache_needs_update = False
|
||||
if cache:
|
||||
try:
|
||||
results = self.cache.get(cache_key)
|
||||
results = self._cache[cache_key]
|
||||
except KeyError:
|
||||
# if cache expires or cache file doesn't exist
|
||||
cache_needs_update = True
|
||||
|
@ -596,7 +596,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||
# If the cache has expired/doesn't exist or if refresh_inventory/flush cache is used
|
||||
# when the user is using caching, update the cached inventory
|
||||
if cache_needs_update or (not cache and self.get_option('cache')):
|
||||
self.cache.set(cache_key, results)
|
||||
self._cache[cache_key] = results
|
||||
|
||||
@staticmethod
|
||||
def _legacy_script_compatible_group_sanitization(name):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue