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
This commit is contained in:
parent
a837cc5694
commit
cf00883c9d
2 changed files with 3 additions and 3 deletions
2
changelogs/fragments/55505-foreman-inventory.yaml
Normal file
2
changelogs/fragments/55505-foreman-inventory.yaml
Normal file
|
@ -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
|
# get next page
|
||||||
params['page'] += 1
|
params['page'] += 1
|
||||||
|
|
||||||
# Set the cache if it is enabled or if the cache was refreshed
|
self._cache[self.cache_key][url] = results
|
||||||
if self.use_cache or self.get_option('cache'):
|
|
||||||
self._cache[self.cache_key][url] = results
|
|
||||||
|
|
||||||
return self._cache[self.cache_key][url]
|
return self._cache[self.cache_key][url]
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue