Skip to content

Commit

Permalink
orcherstra/run: don't use pipes, but shlex
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Aug 3, 2024
1 parent 231736c commit 543c98b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions teuthology/orchestra/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import gevent
import gevent.event
import socket
import pipes
import shlex
import logging
import shutil

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 543c98b

Please sign in to comment.