Update inventory caching to remove deprecation warnings (#53976)

This commit is contained in:
Sloane Hertel 2019-03-26 08:15:12 -05:00 committed by GitHub
parent 1a5732807f
commit a93154c57f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 14 deletions

View file

@ -370,7 +370,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
cache_needs_update = False
if cache:
try:
results = self.cache.get(cache_key)
results = self._cache[cache_key]
for project in results:
for zone in results[project]:
self._add_hosts(results[project][zone], config_data, False)
@ -392,7 +392,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
cached_data[project][zone] = resp.get('items')
if cache_needs_update:
self.cache.set(cache_key, cached_data)
self._cache[cache_key] = cached_data
@staticmethod
def _legacy_script_compatible_group_sanitization(name):