X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ca6c0353c236d5fc0f829880e845cbd8489ea9ad..01ca27ba0a1ef84c53e223004249505435a788b6:/services/fuse/tests/test_exec.py diff --git a/services/fuse/tests/test_exec.py b/services/fuse/tests/test_exec.py index 6af60302bc..f977990026 100644 --- a/services/fuse/tests/test_exec.py +++ b/services/fuse/tests/test_exec.py @@ -9,16 +9,12 @@ import json import multiprocessing import os from . import run_test_server +import shlex import tempfile import unittest from .integration_test import workerPool -try: - from shlex import quote -except: - from pipes import quote - def try_exec(mnt, cmd): try: os.environ['KEEP_LOCAL_STORE'] = tempfile.mkdtemp() @@ -56,11 +52,11 @@ class ExecMode(unittest.TestCase): def test_exec(self): workerPool().apply(try_exec, (self.mnt, [ - 'sh', '-c', - 'echo -n foo >{}; cp {} {}'.format( - quote(os.path.join(self.mnt, 'zzz', 'foo.txt')), - quote(os.path.join(self.mnt, 'zzz', '.arvados#collection')), - quote(os.path.join(self.okfile)))])) + 'sh', '-c', 'echo -n foo >{}; cp {} {}'.format( + shlex.quote(os.path.join(self.mnt, 'zzz', 'foo.txt')), + shlex.quote(os.path.join(self.mnt, 'zzz', '.arvados#collection')), + shlex.quote(os.path.join(self.okfile)), + )])) with open(self.okfile) as f: assertRegex( self,