Skip to content

Commit

Permalink
use new http get wrapper in oracle provider (#386)
Browse files Browse the repository at this point in the history
Signed-off-by: Will Murphy <[email protected]>
  • Loading branch information
willmurphyscode authored Nov 3, 2023
1 parent bef4263 commit 13a1853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 2 additions & 6 deletions src/vunnel/providers/oracle/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
import os
import re

import requests

from vunnel import utils
from vunnel.utils import rpm
from vunnel.utils import http, rpm
from vunnel.utils.oval_parser import Config, parse

# One time initialization of driver specific configuration
Expand Down Expand Up @@ -65,11 +62,10 @@ def __init__(self, workspace, config=None, download_timeout=125, logger=None):
def urls(self):
return [self._url_]

@utils.retry_with_backoff()
def _download(self):
try:
self.logger.info(f"downloading ELSA from {self._url_}")
r = requests.get(self._url_, stream=True, timeout=self.download_timeout)
r = http.get(self._url_, self.logger, stream=True, timeout=self.download_timeout)
if r.status_code != 200:
raise Exception(f"GET {self._url_} failed with HTTP error {r.status_code}")

Expand Down
8 changes: 0 additions & 8 deletions tests/unit/providers/oracle/test_oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,6 @@ def test_filterer(self, input_vulnerability, expected_output):
assert f.filter(input_vulnerability) == expected_output


@pytest.fixture()
def disable_get_requests(monkeypatch):
def disabled(*args, **kwargs):
raise RuntimeError("requests disabled but HTTP GET attempted")

monkeypatch.setattr(parser.requests, "get", disabled)


def test_provider_schema(helpers, disable_get_requests, monkeypatch):
workspace = helpers.provider_workspace_helper(name=Provider.name())

Expand Down

0 comments on commit 13a1853

Please sign in to comment.