Fix wrong ref urls in archlinux importer
#
-# Copyright (c) 2017 nexB Inc. and others. All rights reserved.
+# Copyright (c) nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
# OR CONDITIONS OF ANY KIND, either express or implied. No content created from
# VulnerableCode should be considered or used as legal advice. Consult an Attorney
# for any legal advice.
-# VulnerableCode is a free software code scanning tool from nexB Inc. and others.
+# VulnerableCode is a free software tool from nexB Inc. and others.
# Visit https://github.com/nexB/vulnerablecode/ for support and download.
import dataclasses
import json
@@ -31,12 +31,10 @@ from urllib.request import urlopen
from packageurl import PackageURL
from schema import Regex, Schema, Or
-from vulnerabilities.data_source import (
- DataSource,
- DataSourceConfiguration,
- Advisory,
- VulnerabilityReferenceUnit,
-)
+from vulnerabilities.data_source import Advisory
+from vulnerabilities.data_source import DataSource
+from vulnerabilities.data_source import DataSourceConfiguration
+from vulnerabilities.data_source import VulnerabilityReferenceUnit
def validate_schema(advisory_dict):
@@ -117,10 +115,9 @@ class ArchlinuxDataSource(DataSource):
vuln_references.append(
VulnerabilityReferenceUnit(
reference_id=ref,
- url="https://security.archlinux.org/{}".format(record["name"]),
+ url="https://security.archlinux.org/{}".format(ref),
)
)
- print(vuln_references)
advisories.append(
Advisory(
