Comment 5 for bug 1715428

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-validations (stable/pike)

Reviewed: https://review.openstack.org/501603
Committed: https://git.openstack.org/cgit/openstack/tripleo-validations/commit/?id=efe8a7251fc0737ea76faceef229a7ce934a8f60
Submitter: Jenkins
Branch: stable/pike

commit efe8a7251fc0737ea76faceef229a7ce934a8f60
Author: Ben Nemec <email address hidden>
Date: Tue Aug 29 16:56:43 2017 +0000

    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 0dec2d8afabd52e69021f6fbf3424ea719557868)