mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
add inventory caching & use in virtualbox inventory plugin (#34510)
* Inventory caching * Add inventory caching for virtualbox * Don't populate cache for virtualbox with stdout, use a dict of inventory instead * Fix error creating the cache dir if it doesn't exist * Keep cache default False and set to True in VariableManager __init__ * Check all groups before determining if a host is ungrouped.
This commit is contained in:
parent
9fdaa86c9f
commit
4a1cc661c4
5 changed files with 153 additions and 16 deletions
|
@ -142,7 +142,7 @@ class InventoryManager(object):
|
|||
self._sources = sources
|
||||
|
||||
# get to work!
|
||||
self.parse_sources()
|
||||
self.parse_sources(cache=True)
|
||||
|
||||
@property
|
||||
def localhost(self):
|
||||
|
@ -234,7 +234,7 @@ class InventoryManager(object):
|
|||
|
||||
# recursively deal with directory entries
|
||||
fullpath = os.path.join(b_source, i)
|
||||
parsed_this_one = self.parse_source(to_native(fullpath))
|
||||
parsed_this_one = self.parse_source(to_native(fullpath), cache=cache)
|
||||
display.debug(u'parsed %s as %s' % (fullpath, parsed_this_one))
|
||||
if not parsed:
|
||||
parsed = parsed_this_one
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue