Skip to content

Commit

Permalink
fix warning 'FixedBy' when I scanning a image (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
botranvan authored and joelee2012 committed Feb 18, 2020
1 parent 6612637 commit 6abdadd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions claircli/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ def process_data(self, threshold='Unknown', white_list=None):

def is_approved(vulne, feature):
vname = vulne['Name'].replace(':', '-')
return (vname in approved and feature['Name'] == approved[vname]) \
or (SEVERITY_INDEX[vulne['Severity']]
> SEVERITY_INDEX[threshold])
return (vname in approved and feature[
'Name'] == approved[vname]) or (SEVERITY_INDEX[vulne[
'Severity']] > SEVERITY_INDEX[threshold])

for feature in layer_data.get('Features', []):
for vulnerability in feature.get('Vulnerabilities', []):
Expand All @@ -62,8 +62,7 @@ def is_approved(vulne, feature):
'FeatureVersion': feature['Version'],
'AddedBy': feature['AddedBy'],
'Status': status}
for key in ['Name', 'NamespaceName', 'Description',
'Link', 'Severity', 'FixedBy']:
for key in vulnerability.keys():
temp[key] = vulnerability[key]
vulnerabilities.append(temp)
data['Vulnerabilities'] = sorted(
Expand Down

0 comments on commit 6abdadd

Please sign in to comment.