mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-09 01:44:03 -07:00
minimize loading files/plugins
avoids some repetitive loading - read config file only once - now cache the ini parser per file - optimize shell plugin loading tried to 'optimize' vars_plugins loading but it creates issues with precedence, probalby due to iterator not being reset, will look into it in subsequent fix/PR
This commit is contained in:
parent
34c002c771
commit
42912e1ac8
3 changed files with 20 additions and 11 deletions
|
@ -241,6 +241,7 @@ class VariableManager:
|
|||
inventory_dir = os.path.dirname(inventory_dir)
|
||||
|
||||
for plugin in vars_loader.all():
|
||||
|
||||
data = combine_vars(data, _get_plugin_vars(plugin, inventory_dir, entities))
|
||||
return data
|
||||
|
||||
|
@ -248,6 +249,7 @@ class VariableManager:
|
|||
''' merges all entities adjacent to play '''
|
||||
data = {}
|
||||
for plugin in vars_loader.all():
|
||||
|
||||
for path in basedirs:
|
||||
data = combine_vars(data, _get_plugin_vars(plugin, path, entities))
|
||||
return data
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue