Merge "Always write ansible-playbook-command.sh"

This commit is contained in:
Zuul 2021-09-24 20:31:25 +00:00 committed by Gerrit Code Review
commit 77edee9651
3 changed files with 7 additions and 2 deletions

View File

@ -217,6 +217,9 @@ class FakeRunnerConfig(object):
env = dict() # noqa
artifact_dir = ''
def __init__(self):
self.command = []
def prepare(self):
pass

View File

@ -206,10 +206,12 @@ class TestRunAnsiblePlaybook(TestCase):
extra_vars=arglist
)
@mock.patch('os.chmod')
@mock.patch('six.moves.builtins.open')
@mock.patch('tripleoclient.utils.makedirs')
@mock.patch('os.path.exists', side_effect=(False, True, True))
def test_run_with_timeout(self, mock_exists, mock_mkdir, mock_open):
def test_run_with_timeout(self, mock_exists, mock_mkdir, mock_open,
mock_chmod):
ansible_runner.ArtifactLoader = mock.MagicMock()
ansible_runner.Runner.run = mock.MagicMock(return_value=('', 0))
ansible_runner.runner_config = mock.MagicMock()

View File

@ -252,7 +252,7 @@ def run_ansible_playbook(playbook, inventory, workdir, playbook_dir=None,
parallel_run=False,
callback_whitelist=constants.ANSIBLE_CWL,
ansible_cfg=None, ansible_timeout=30,
reproduce_command=False,
reproduce_command=True,
timeout=None, forks=None):
"""Simple wrapper for ansible-playbook.