diff options
| author | Daniel P. Berrangé <berrange@redhat.com> | 2024-12-17 15:59:49 +0000 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2024-12-17 19:39:53 +0100 |
| commit | 37e9b19c34d9500164e33ccf377e1830e956bca0 (patch) | |
| tree | 4699be481053c51effb54772ffc6d81c965b3234 /tests/functional/qemu_test/archive.py | |
| parent | 3bb4c8b6134df5367675c4ade4f5c177d29fe903 (diff) | |
| download | focaccia-qemu-37e9b19c34d9500164e33ccf377e1830e956bca0.tar.gz focaccia-qemu-37e9b19c34d9500164e33ccf377e1830e956bca0.zip | |
tests/functional: replace 'run_cmd' with subprocess helpers
The 'run_cmd' helper is re-implementing a convenient helper that already exists in the form of the 'run' and 'check_call' methods provided by 'subprocess'. Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Message-ID: <20241217155953.3950506-29-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/archive.py')
| -rw-r--r-- | tests/functional/qemu_test/archive.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/functional/qemu_test/archive.py b/tests/functional/qemu_test/archive.py index c439d9413a..c803fdaf6d 100644 --- a/tests/functional/qemu_test/archive.py +++ b/tests/functional/qemu_test/archive.py @@ -14,7 +14,6 @@ from urllib.parse import urlparse import zipfile from .asset import Asset -from .cmd import run_cmd def tar_extract(archive, dest_dir, member=None): @@ -52,9 +51,11 @@ def deb_extract(archive, dest_dir, member=None): cwd = os.getcwd() os.chdir(dest_dir) try: - (stdout, stderr, ret) = run_cmd(['ar', 't', archive]) - file_path = stdout.split()[2] - run_cmd(['ar', 'x', archive, file_path]) + proc = run(['ar', 't', archive], + check=True, capture_output=True, encoding='utf8') + file_path = proc.stdout.split()[2] + check_call(['ar', 'x', archive, file_path], + stdout=DEVNULL, stderr=DEVNULL) tar_extract(file_path, dest_dir, member) finally: os.chdir(cwd) |