From afd7941dfed0a1c3ffb6d303f9bc2dcdcac094ef Mon Sep 17 00:00:00 2001 From: Megan O'Keefe <3137106+askmeegs@users.noreply.github.com> Date: Thu, 25 Mar 2021 11:45:37 -0400 Subject: [PATCH] fix: effective severity attribute error (#104) --- .../google-cloud-containeranalysis/samples/snippets/samples.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-containeranalysis/samples/snippets/samples.py b/packages/google-cloud-containeranalysis/samples/snippets/samples.py index 48d193be7919..ecf28c43b837 100644 --- a/packages/google-cloud-containeranalysis/samples/snippets/samples.py +++ b/packages/google-cloud-containeranalysis/samples/snippets/samples.py @@ -367,7 +367,7 @@ def find_high_severity_vulnerabilities_for_image(resource_url, project_id): vulnerabilities = grafeas_client.list_occurrences(parent=project_name, filter=filter_str) filtered_list = [] for v in vulnerabilities: - if v.effective_severity == Severity.HIGH or v.effective_severity == Severity.CRITICAL: + if v.vulnerability.effective_severity == Severity.HIGH or v.vulnerability.effective_severity == Severity.CRITICAL: filtered_list.append(v) return filtered_list # [END containeranalysis_filter_vulnerability_occurrences]