allow openstack invetnory to work cacheless

fixes #45431

(cherry picked from commit a47671aad1)
pull/50616/head
Brian Coca 6 years ago committed by Toshio Kuratomi
parent 3244f9592b
commit 8490588afa

@ -0,0 +1,2 @@
bugfixes:
- allow using openstack inventory plugin w/o a cache

@ -196,7 +196,8 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
source_data = cloud_inventory.list_hosts(
expand=expand_hostvars, fail_on_cloud_config=fail_on_errors)
self.cache.set(cache_key, source_data)
if self.cache is not None:
self.cache.set(cache_key, source_data)
self._populate_from_source(source_data)

Loading…
Cancel
Save