mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-07 11:20:28 -07:00
Update inventory caching to remove deprecation warnings (#53976)
This commit is contained in:
parent
fe65ed63ed
commit
9929887c70
1 changed files with 2 additions and 2 deletions
|
@ -370,7 +370,7 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
||||||
cache_needs_update = False
|
cache_needs_update = False
|
||||||
if cache:
|
if cache:
|
||||||
try:
|
try:
|
||||||
results = self.cache.get(cache_key)
|
results = self._cache[cache_key]
|
||||||
for project in results:
|
for project in results:
|
||||||
for zone in results[project]:
|
for zone in results[project]:
|
||||||
self._add_hosts(results[project][zone], config_data, False)
|
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')
|
cached_data[project][zone] = resp.get('items')
|
||||||
|
|
||||||
if cache_needs_update:
|
if cache_needs_update:
|
||||||
self.cache.set(cache_key, cached_data)
|
self._cache[cache_key] = cached_data
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _legacy_script_compatible_group_sanitization(name):
|
def _legacy_script_compatible_group_sanitization(name):
|
||||||
|
|
Loading…
Add table
Reference in a new issue