Comment 9 for bug 1703703

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/ocata)

Reviewed: https://review.openstack.org/483571
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=3fb8722012a991855fc760ba450ed74acd8b43d2
Submitter: Jenkins
Branch: stable/ocata

commit 3fb8722012a991855fc760ba450ed74acd8b43d2
Author: Zane Bitter <email address hidden>
Date: Thu Jul 13 13:59:27 2017 -0400

    Don't load new copies of current resources

    The Stack._find_filtered_resources() method returns Resource objects for
    all resources associated with the Stack, regardless of whether they are
    current (present in the template; latest version in the case of
    convergence). To do this, it previously created a new Resource object
    for every resource found in the database.

    However, for those resources which *are* current this is unnecessary. We
    can access the Resource object simply through self.resources. It turns
    out this is necessary for obtaining the required_by list for legacy
    stacks, because only the Resources obtained from self.resources also
    appear in the Dependencies graph obtained from self.dependencies. The
    required_by list is read when listing or showing resources, which would
    either return an empty list or fail for legacy stacks.

    This patch also makes the Resource.required_by() method more robust in
    its error handling.

    Change-Id: Id438336e5c88dc7c2d168ba01ee703faa17e8b8e
    Closes-Bug: #1703703
    Related-Bug: #1523748
    (cherry picked from commit 5ce238fb17e38702ceef85a3706e9d2236c43e0e
                           and 65630d4e8bbff2f3ae5c659f8e9396ec7a6f6ae9)