Skip to content

Commit

Permalink
Remove comment, replace alpine linux fetch_response() with new util…
Browse files Browse the repository at this point in the history
…s.py function #597

Reference: #597
Reference: #935

Signed-off-by: John M. Horan <[email protected]>
  • Loading branch information
johnmhoran committed Oct 18, 2022
1 parent 0d71aa3 commit ad3ebeb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 1 addition & 10 deletions vulnerabilities/importers/alpine_linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from vulnerabilities.references import WireSharkReference
from vulnerabilities.references import XsaReference
from vulnerabilities.references import ZbxReference
from vulnerabilities.utils import fetch_response
from vulnerabilities.utils import is_cve

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


def fetch_response(url):
"""
Fetch and return `response` from the `url`
"""
response = requests.get(url)
if response.status_code == 200:
return response
raise Exception(f"Failed to fetch data from {url!r} with status code: {response.status_code!r}")


def fetch_advisory_directory_links(page_response_content: str) -> List[str]:
"""
Return a list of advisory directory links present in `page_response_content` html string
Expand Down
2 changes: 0 additions & 2 deletions vulnerabilities/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ def base32_custom(btes):
return bytes(encoded)


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

0 comments on commit ad3ebeb

Please sign in to comment.