Add catch-all for property errors in implicit dependencies

The previous patch ensures that we ignore errors getting properties in
all extant add_dependencies() methods for calculating implicit
dependencies. To guard against similar errors in future, also ignore and
log any uncaught ValueError or TypeError exceptions encountered during
implicit dependency calculation.

Change-Id: I2cac0add975e36a9c52b9cbb50f0660882322754
Related-Bug: #1708209
This commit is contained in:
Zane Bitter 2017-08-02 14:49:22 -04:00
parent b50df6b1fc
commit 4979b06bb4
1 changed files with 5 additions and 1 deletions

View File

@ -506,7 +506,11 @@ class Stack(collections.Mapping):
try:
res.add_dependencies(deps)
except Exception as exc:
if not ignore_errors:
# Always ignore ValueError/TypeError, as they're likely to
# have come from trying to read invalid property values that
# haven't been validated yet.
if not (ignore_errors or
isinstance(exc, (ValueError, TypeError))):
raise
else:
LOG.warning('Ignoring error adding implicit '