Skip to content

Commit 533682f

Browse files
committed
Removed fallback request call using Chrome and Firefox cookies
no point in requests using cookies from a cron job - we need krb authentication anyway. While running in openshift contaier the error was: File "/opt/app-root/lib64/python3.12/site-packages/browser_cookie3/init.py", line 205, in enter self.__connection = open_dbus_connection() ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.12/site-packages/jeepney/io/blocking.py", line 328, in open_dbus_connection bus_addr = get_bus(bus) ^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.12/site-packages/jeepney/bus.py", line 53, in get_bus return find_session_bus() ^^^^^^^^^^^^^^^^^^ File "/opt/app-root/lib64/python3.12/site-packages/jeepney/bus.py", line 42, in find_session_bus addr = os.environ['DBUS_SESSION_BUS_ADDRESS'] ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen os>", line 714, in getitem KeyError: 'DBUS_SESSION_BUS_ADDRESS'
1 parent 4536ab3 commit 533682f

1 file changed

Lines changed: 1 addition & 32 deletions

File tree

data_scraper/processors/ci_logs_provider.py

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -95,38 +95,7 @@ def make_authenticated_request(url, params=None, timeout=30.0):
9595

9696
except (httpx.HTTPError, httpx.RequestError, httpx.TimeoutException) as e:
9797
LOG.warning("Kerberos authentication failed due to HTTP error: %s", e)
98-
LOG.info("Falling back to browser cookies authentication...")
99-
100-
# Second try with cookies from browsers
101-
cookies = None
102-
if 'redhat.com' in domain:
103-
try:
104-
cookies = browser_cookie3.chrome(domain_name=domain)
105-
LOG.info("Using Chrome cookies for domain: %s", domain)
106-
except (ImportError, RuntimeError, FileNotFoundError) as chrome_error:
107-
LOG.warning("Could not get Chrome cookies: %s", chrome_error)
108-
109-
try:
110-
cookies = browser_cookie3.firefox(domain_name=domain)
111-
LOG.info("Using Firefox cookies for domain: %s", domain)
112-
except (ImportError, RuntimeError, FileNotFoundError) as firefox_error:
113-
LOG.warning("Could not get Firefox cookies: %s", firefox_error)
114-
115-
try:
116-
response = requests.get(
117-
url,
118-
params=params,
119-
cookies=cookies,
120-
verify=verify,
121-
timeout=timeout
122-
)
123-
response.raise_for_status()
124-
return response.text
125-
126-
except (requests.RequestException, requests.HTTPError, requests.ConnectionError,
127-
requests.Timeout, requests.TooManyRedirects) as request_error:
128-
LOG.error("Error fetching from %s: %s", url, request_error)
129-
return None
98+
return None
13099

131100
class TempestResultsParser:
132101
"""Parser for tempest test HTML reports."""

0 commit comments

Comments
 (0)