From 28a5f3b9d61f77e386b88cdc763f5d70e72272cc Mon Sep 17 00:00:00 2001 From: Grzegorz Grasza Date: Tue, 24 Nov 2020 11:41:05 +0100 Subject: [PATCH] Fix the order of arguments to tar tar needs the filename to appear after the 'f' option. Closes-bug: #1905406 Change-Id: I7d0539ce736e34639dbd6600351c4b269c4fff2f --- .../ansible_plugins/modules/tripleo_deploy_artifacts.py | 2 +- tripleo_ansible/tests/modules/test_tripleo_deploy_artifacts.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tripleo_ansible/ansible_plugins/modules/tripleo_deploy_artifacts.py b/tripleo_ansible/ansible_plugins/modules/tripleo_deploy_artifacts.py index 048e693f3..1bc0e166d 100644 --- a/tripleo_ansible/ansible_plugins/modules/tripleo_deploy_artifacts.py +++ b/tripleo_ansible/ansible_plugins/modules/tripleo_deploy_artifacts.py @@ -89,7 +89,7 @@ def deploy_rpm(filename): def deploy_targz(filename): - cmd = "tar xvzf -C / " + filename + cmd = "tar xvz -C / -f " + filename try: _ = subprocess.run(cmd, shell=True, check=True, stderr=subprocess.PIPE, universal_newlines=True) diff --git a/tripleo_ansible/tests/modules/test_tripleo_deploy_artifacts.py b/tripleo_ansible/tests/modules/test_tripleo_deploy_artifacts.py index f3ad51c3b..cc271662e 100644 --- a/tripleo_ansible/tests/modules/test_tripleo_deploy_artifacts.py +++ b/tripleo_ansible/tests/modules/test_tripleo_deploy_artifacts.py @@ -132,7 +132,7 @@ class TestTripleoDeployArtifacts(tests_base.TestCase): @mock.patch('subprocess.run') def test_deploy_targz(self, mock_run): tripleo_deploy_artifacts.deploy_targz('foo') - mock_run.assert_called_once_with('tar xvzf -C / foo', check=True, + mock_run.assert_called_once_with('tar xvz -C / -f foo', check=True, shell=True, stderr=-1, universal_newlines=True)