Skip to content

Commit ad3ebeb

Browse files
committed
Remove comment, replace alpine linux fetch_response() with new utils.py function #597
Reference: #597 Reference: #935 Signed-off-by: John M. Horan <[email protected]>
1 parent 0d71aa3 commit ad3ebeb

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

vulnerabilities/importers/alpine_linux.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from vulnerabilities.references import WireSharkReference
3232
from vulnerabilities.references import XsaReference
3333
from vulnerabilities.references import ZbxReference
34+
from vulnerabilities.utils import fetch_response
3435
from vulnerabilities.utils import is_cve
3536

3637
LOGGER = logging.getLogger(__name__)
@@ -58,16 +59,6 @@ def advisory_data(self) -> Iterable[AdvisoryData]:
5859
yield from process_record(record)
5960

6061

61-
def fetch_response(url):
62-
"""
63-
Fetch and return `response` from the `url`
64-
"""
65-
response = requests.get(url)
66-
if response.status_code == 200:
67-
return response
68-
raise Exception(f"Failed to fetch data from {url!r} with status code: {response.status_code!r}")
69-
70-
7162
def fetch_advisory_directory_links(page_response_content: str) -> List[str]:
7263
"""
7364
Return a list of advisory directory links present in `page_response_content` html string

vulnerabilities/utils.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ def base32_custom(btes):
412412
return bytes(encoded)
413413

414414

415-
# 9/28/2022 Wednesday 1:07:41 PM.Copy from /home/jmh/dev/nexb/vulnerablecode/vulnerabilities/importers/alpine_linux.py
416-
# for use in /home/jmh/dev/nexb/vulnerablecode/vulnerabilities/importers/archlinux.py
417415
def fetch_response(url):
418416
"""
419417
Fetch and return `response` from the `url`

0 commit comments

Comments
 (0)