Skip to content

Commit

Permalink
Merge pull request #465 from miteshvp/use_declared_licenses
Browse files Browse the repository at this point in the history
  • Loading branch information
jpopelka authored Dec 19, 2017
2 parents f22d9b4 + 7559ef7 commit f1c854a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions f8a_worker/graphutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def extract_component_details(component):
"vulnerabilities": cves
}

licenses = component.get("version", {}).get("licenses", [])
licenses = component.get("version", {}).get("declared_licenses", [])
name = component.get("version", {}).get("pname", [""])[0]
version = component.get("version", {}).get("version", [""])[0]
ecosystem = component.get("version", {}).get("pecosystem", [""])[0]
Expand Down Expand Up @@ -213,7 +213,7 @@ def create_package_dict(graph_results, alt_dict=None):
'ecosystem': ecosystem,
'name': name,
'version': version,
'licenses': epv['ver'].get('licenses', []),
'licenses': epv['ver'].get('declared_licenses', []),
'latest_version': select_latest_version(
epv['pkg'].get('libio_latest_version', [''])[0],
epv['pkg'].get('latest_version', [''])[0]),
Expand Down
4 changes: 2 additions & 2 deletions f8a_worker/workers/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ def apply_license_filter(user_stack_components, epv_list_alt, epv_list_com):
license_scoring_input = {
'package': epv.get('pkg', {}).get('name', [''])[0],
'version': epv.get('ver', {}).get('version', [''])[0],
'licenses': epv.get('ver', {}).get('licenses', [])
'licenses': epv.get('ver', {}).get('declared_licenses', [])
}
license_score_list_alt.append(license_scoring_input)

Expand All @@ -684,7 +684,7 @@ def apply_license_filter(user_stack_components, epv_list_alt, epv_list_com):
license_scoring_input = {
'package': epv.get('pkg', {}).get('name', [''])[0],
'version': epv.get('ver', {}).get('version', [''])[0],
'licenses': epv.get('ver', {}).get('licenses', [])
'licenses': epv.get('ver', {}).get('declared_licenses', [])
}
license_score_list_com.append(license_scoring_input)

Expand Down
2 changes: 1 addition & 1 deletion f8a_worker/workers/stackaggregator_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def extract_component_details(component):
}
cves.append(component_cve)

licenses = component.get("version", {}).get("licenses", [])
licenses = component.get("version", {}).get("declared_licenses", [])
name = component.get("version", {}).get("pname", [""])[0]
version = component.get("version", {}).get("version", [""])[0]
ecosystem = component.get("version", {}).get("pecosystem", [""])[0]
Expand Down

0 comments on commit f1c854a

Please sign in to comment.