Move ansible-runner version to 1.4.0

Upstream requirements in stable/train is under ansible-runner 1.4.0.
This patch move the version to 1.4.0 according to openstack/requirements.
It changes the backward compat version according to this version in
validations_libs/ansible.py

Change-Id: I311d077c13a7d95314eb83072f5652646fef1bf8
This commit is contained in:
Mathieu Bultel 2020-12-17 09:44:27 +01:00
parent e9fe6b5b1b
commit 87e4917f1b
3 changed files with 22 additions and 9 deletions

View File

@ -6,4 +6,4 @@ pbr>=3.1.1 # Apache-2.0
six>=1.11.0 # MIT six>=1.11.0 # MIT
PyYAML>=3.13 # MIT PyYAML>=3.13 # MIT
ansible>=2.8,!=2.8.9,!=2.9.12,<2.10.0 ansible>=2.8,!=2.8.9,!=2.9.12,<2.10.0
ansible-runner>=1.3.4 # Apache-2.0 ansible-runner>=1.4.0 # Apache-2.0

View File

@ -39,7 +39,7 @@ except NameError:
try: try:
version = pkg_resources.get_distribution("ansible_runner").version version = pkg_resources.get_distribution("ansible_runner").version
backward_compat = (version < '1.4.4') backward_compat = (version < '1.4.0')
except pkg_resources.DistributionNotFound: except pkg_resources.DistributionNotFound:
backward_compat = False backward_compat = False

View File

@ -13,6 +13,7 @@
# under the License. # under the License.
# #
import pkg_resources
try: try:
from unittest import mock from unittest import mock
except ImportError: except ImportError:
@ -23,6 +24,12 @@ from ansible_runner import Runner
from validations_libs.ansible import Ansible from validations_libs.ansible import Ansible
from validations_libs.tests import fakes from validations_libs.tests import fakes
try:
version = pkg_resources.get_distribution("ansible_runner").version
backward_compat = (version < '1.4.0')
except pkg_resources.DistributionNotFound:
backward_compat = False
class TestAnsible(TestCase): class TestAnsible(TestCase):
@ -171,21 +178,27 @@ class TestAnsible(TestCase):
workdir='/tmp', workdir='/tmp',
log_path='/tmp/foo' log_path='/tmp/foo'
) )
opt = { opt = {
'artifact_dir': '/tmp', 'artifact_dir': '/tmp',
'envvars': {
'ANSIBLE_STDOUT_CALLBACK': 'fake.py',
'ANSIBLE_CONFIG': '/tmp/foo/artifacts/ansible.cfg',
'VALIDATIONS_LOG_DIR': '/tmp/foo'},
'extravars': {}, 'extravars': {},
'fact_cache': '/tmp/foo/artifacts/',
'fact_cache_type': 'jsonfile',
'ident': '', 'ident': '',
'inventory': 'localhost,', 'inventory': 'localhost,',
'playbook': 'existing.yaml', 'playbook': 'existing.yaml',
'private_data_dir': '/tmp', 'private_data_dir': '/tmp',
'project_dir': '/tmp',
'quiet': False, 'quiet': False,
'rotate_artifacts': 256, 'rotate_artifacts': 256,
'verbosity': 0} 'verbosity': 0}
if not backward_compat:
opt.update({
'envvars': {
'ANSIBLE_STDOUT_CALLBACK': 'fake.py',
'ANSIBLE_CONFIG': '/tmp/foo/artifacts/ansible.cfg',
'VALIDATIONS_LOG_DIR': '/tmp/foo'},
'project_dir': '/tmp',
'fact_cache': '/tmp/foo/artifacts/',
'fact_cache_type': 'jsonfile'
})
mock_config.assert_called_with(**opt) mock_config.assert_called_with(**opt)