tripleo-validations/tripleo_validations
Ben Nemec efe8a7251f Lazy load the entire stack instead of single outputs
Each call to output_show is taking around 15 seconds for me, which
causes the entire inventory process to take 90 seconds or more.
Loading the entire stack with outputs resolved only takes around
20 seconds and keeps the total runtime of the dynamic inventory
much shorter overall because it only has to be done once.

The stack is lazy loaded at the first call to __getitem__ because it
seems that Ansible instantiates multiple copies of the class but
never actually looks anything up in some of them, so if we load the
stack in the constructor we just waste time retrieving it
unnecessarily.

This change has reduced the time it takes to run even simple ad-hoc
commands against a small 2 node inventory from 2.5-3 minutes to
45 seconds (which is still too long IMHO, but a step in the right
direction).

Closes-Bug: #1715428
Change-Id: I0fcde3f7641ccc26f045fcc8146ec4067e45330c
(cherry picked from commit 0dec2d8afa)
2017-09-07 07:29:18 +00:00
..
tests Lazy load the entire stack instead of single outputs 2017-09-07 07:29:18 +00:00
__init__.py Add reno for release notes management 2017-01-25 18:11:16 +01:00
inventory.py Lazy load the entire stack instead of single outputs 2017-09-07 07:29:18 +00:00
utils.py Add lookup plugin for tripleo heat templates 2017-04-18 15:49:05 +00:00