21840: Migrate from pipes.quote to shlex.quote
authorBrett Smith <brett.smith@curii.com>
Tue, 28 May 2024 15:40:30 +0000 (11:40 -0400)
committerBrett Smith <brett.smith@curii.com>
Tue, 28 May 2024 15:55:48 +0000 (11:55 -0400)
To avoid the pipes deprecation in modern Python.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>

jenkins/run_upload_packages.py

index 216b56b14958d10773ec74ad0b0f566b8beceb86..991d821acffe2824254fcddfade6c9e30a8b11b3 100755 (executable)
@@ -11,8 +11,8 @@ import glob
 import locale
 import logging
 import os
-import pipes
 import re
+import shlex
 import shutil
 import subprocess
 import sys
@@ -191,8 +191,8 @@ class DistroPackageSuite(PackageSuite):
         # self.__class__.__name__ provides $0 for the script, which makes a
         # nicer message if there's an error.
         subprocess.check_call(self._build_cmd(
-                'ssh', self.ssh_host, 'bash', '-ec', pipes.quote(script),
-                self.__class__.__name__, *(pipes.quote(s) for s in args)))
+                'ssh', self.ssh_host, 'bash', '-ec', shlex.quote(script),
+                self.__class__.__name__, *(shlex.quote(s) for s in args)))
 
     def upload_files(self, paths):
         dest_dir = os.path.join(self.REMOTE_DEST_DIR, self.target)