Merge pull request #2661 from kleesc/securityworker_cpu

Raise an APIRequestFailure exception when security scanner is unavail…
This commit is contained in:
Kenny Lee Sin Cheong 2017-06-03 12:15:45 -04:00 committed by GitHub
commit 1f76e9dc3b
3 changed files with 9 additions and 5 deletions

View file

@ -57,7 +57,7 @@ class LayerAnalyzer(object):
except AnalyzeLayerRetryException:
# Something went wrong when trying to analyze the layer, but we should retry, so leave
# the layer unindexed. Another worker will come along and handle it.
pass
raise APIRequestFailure
except MissingParentLayerException:
# Pass upward, as missing parent is handled in the analyze_recursively method.
raise
@ -145,7 +145,7 @@ class LayerAnalyzer(object):
try:
layer_data = self._api.get_layer_data(layer, include_vulnerabilities=True)
except APIRequestFailure:
layer_data = None
raise
if layer_data is not None:
# Dispatch events for any detected vulnerabilities