From 725b55295f25ebcaefd9700df5622f1a51171bb9 Mon Sep 17 00:00:00 2001 From: Andrii V Date: Fri, 19 Sep 2025 13:05:13 +0200 Subject: [PATCH] fix: suppress deprecation error for SSH as well --- rhodecode/apps/ssh_support/lib/ssh_wrapper_v1.py | 4 ++++ rhodecode/apps/ssh_support/lib/ssh_wrapper_v2.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/rhodecode/apps/ssh_support/lib/ssh_wrapper_v1.py b/rhodecode/apps/ssh_support/lib/ssh_wrapper_v1.py index 03c51bae..0585ab8c 100644 --- a/rhodecode/apps/ssh_support/lib/ssh_wrapper_v1.py +++ b/rhodecode/apps/ssh_support/lib/ssh_wrapper_v1.py @@ -25,6 +25,7 @@ import click from rhodecode.lib.pyramid_utils import bootstrap from rhodecode.lib.statsd_client import StatsdClient +from rhodecode.config.patches import suppress_pkg_resources_warnings from .backends import SshWrapper from .utils import setup_custom_logging @@ -47,6 +48,9 @@ log = logging.getLogger(__name__) @click.option("--shell", "-s", is_flag=True, help="Allow Shell") @click.option("--debug", is_flag=True, help="Enabled detailed output logging") def main(ini_path, mode, user, user_id, key_id, shell, debug): + # Apply pkg_resources deprecation warning suppression early + suppress_pkg_resources_warnings() + setup_custom_logging(ini_path, debug) command = os.environ.get("SSH_ORIGINAL_COMMAND", "") diff --git a/rhodecode/apps/ssh_support/lib/ssh_wrapper_v2.py b/rhodecode/apps/ssh_support/lib/ssh_wrapper_v2.py index 060a2cd1..913fdccb 100644 --- a/rhodecode/apps/ssh_support/lib/ssh_wrapper_v2.py +++ b/rhodecode/apps/ssh_support/lib/ssh_wrapper_v2.py @@ -32,6 +32,7 @@ import logging import click from rhodecode.config.config_maker import sanitize_settings_and_apply_defaults +from rhodecode.config.patches import suppress_pkg_resources_warnings from rhodecode.lib.request import Request from rhodecode.lib.utils2 import AttributeDict from rhodecode.lib.statsd_client import StatsdClient @@ -59,6 +60,9 @@ log = logging.getLogger(__name__) @click.option("--shell", "-s", is_flag=True, help="Allow Shell") @click.option("--debug", is_flag=True, help="Enabled detailed output logging") def main(ini_path, mode, user, user_id, key_id, shell, debug): + # Apply pkg_resources deprecation warning suppression early + suppress_pkg_resources_warnings() + time_start = time.time() setup_custom_logging(ini_path, debug)