From f8a31dda1c07a8a842471a2e29ef867553c5b3aa Mon Sep 17 00:00:00 2001 From: Travis Hathaway Date: Thu, 9 Jan 2025 17:38:12 +0100 Subject: [PATCH] adding a bug fix for plugin setting access --- conda_anaconda_telemetry/hooks.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/conda_anaconda_telemetry/hooks.py b/conda_anaconda_telemetry/hooks.py index 74fc6a7..03b1953 100644 --- a/conda_anaconda_telemetry/hooks.py +++ b/conda_anaconda_telemetry/hooks.py @@ -241,12 +241,11 @@ def _conda_request_headers() -> Sequence[HeaderWrapper]: @hookimpl def conda_session_headers(host: str) -> Iterator[CondaRequestHeader]: """Return a list of custom headers to be included in the request.""" - if context.plugins.anaconda_telemetry: - try: - if host in REQUEST_HEADER_HOSTS: - yield from validate_headers(_conda_request_headers()) - except Exception as exc: - logger.debug("Failed to collect telemetry data", exc_info=exc) + try: + if context.plugins.anaconda_telemetry and host in REQUEST_HEADER_HOSTS: + yield from validate_headers(_conda_request_headers()) + except Exception as exc: + logger.debug("Failed to collect telemetry data", exc_info=exc) @hookimpl