Add implicit deps after calculation of all explicit deps

Now we have graph of explicit dependencies builded before calculation
any implicit dependency in add_dependencies(). This will help to fix
several bugs and enhance some implicit dependencies calculation in cases,
when we need all explicit deps to be known.

Related-Bug: #1626634

Change-Id: Iebef2600781b867db5925346b444dec4d953aefa
This commit is contained in:
Oleksii Chuprykov 2016-10-04 18:12:33 +03:00
parent 885eb51ecc
commit de319d211e
1 changed files with 3 additions and 4 deletions

View File

@ -389,7 +389,6 @@ class Stack(collections.Mapping):
def dependencies(self):
if self._dependencies is None:
self._dependencies = self._get_dependencies(
six.itervalues(self.resources),
ignore_errors=self.id is not None)
return self._dependencies
@ -463,13 +462,13 @@ class Stack(collections.Mapping):
for out in six.itervalues(outputs)))
return set(itertools.chain.from_iterable(attr_lists))
@staticmethod
def _get_dependencies(resources, ignore_errors=True):
def _get_dependencies(self, ignore_errors=True):
"""Return the dependency graph for a list of resources."""
deps = dependencies.Dependencies()
for res in resources:
for res in six.itervalues(self.resources):
res.add_explicit_dependencies(deps)
for res in six.itervalues(self.resources):
try:
res.add_dependencies(deps)
except Exception as exc: