From 543c98b9df83e97f80ead3a5fd5f2bb87287e3a0 Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Sat, 3 Aug 2024 17:08:48 +0200 Subject: [PATCH] orcherstra/run: don't use pipes, but shlex Finally get rid of deprecation warning for 'pipes': teuthology/orchestra/run.py:12 /teuthology/teuthology/orchestra/run.py:12: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13 import pipes Signed-off-by: Kyr Shatskyy --- teuthology/orchestra/run.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index f31dfd0d7f..bf6a069533 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -9,7 +9,7 @@ import gevent import gevent.event import socket -import pipes +import shlex import logging import shutil @@ -252,7 +252,7 @@ def _quote(args): if isinstance(a, Raw): yield a.value else: - yield pipes.quote(a) + yield shlex.quote(a) if isinstance(args, list): return ' '.join(_quote(args)) else: @@ -400,7 +400,7 @@ def run( """ Run a command remotely. If any of 'args' contains shell metacharacters that you want to pass unquoted, pass it as an instance of Raw(); otherwise - it will be quoted with pipes.quote() (single quote, and single quotes + it will be quoted with shlex.quote() (single quote, and single quotes enclosed in double quotes). :param client: SSHConnection to run the command with