]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
orcherstra/run: don't use pipes, but shlex 1996/head
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Sat, 3 Aug 2024 15:08:48 +0000 (17:08 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Wed, 7 Aug 2024 20:40:07 +0000 (22:40 +0200)
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 <kyrylo.shatskyy@clyso.com>
teuthology/orchestra/run.py

index f31dfd0d7fc1db89feab1f67abdc95c809a9731d..bf6a0695332f66ffedba03bc0d4fbeeb32cf8f53 100644 (file)
@@ -9,7 +9,7 @@ from paramiko import ChannelFile
 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