Return results even when the cache is disabled (#55505)

* Return results even when the cache is disabled

By default the cache is disabled and so the results of the API call
are not placed in there for the return statement to fetch.

* Always update self._cache to return
pull/57090/head
Matt Williams 5 years ago committed by Brian Coca
parent a837cc5694
commit cf00883c9d

@ -0,0 +1,2 @@
bugfixes:
- Fix foreman inventory plugin when inventory caching is disabled

@ -162,9 +162,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable):
# get next page
params['page'] += 1
# Set the cache if it is enabled or if the cache was refreshed
if self.use_cache or self.get_option('cache'):
self._cache[self.cache_key][url] = results
self._cache[self.cache_key][url] = results
return self._cache[self.cache_key][url]

Loading…
Cancel
Save