Browse Source

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
changes/96/767496/3
Mathieu Bultel 1 year ago
parent
commit
87e4917f1b
  1. 2
      requirements.txt
  2. 2
      validations_libs/ansible.py
  3. 27
      validations_libs/tests/test_ansible.py

2
requirements.txt

@ -6,4 +6,4 @@ pbr>=3.1.1 # Apache-2.0
six>=1.11.0 # MIT
PyYAML>=3.13 # MIT
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

2
validations_libs/ansible.py

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

27
validations_libs/tests/test_ansible.py

@ -13,6 +13,7 @@
# under the License.
#
import pkg_resources
try:
from unittest import mock
except ImportError:
@ -23,6 +24,12 @@ from ansible_runner import Runner
from validations_libs.ansible import Ansible
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):
@ -171,21 +178,27 @@ class TestAnsible(TestCase):
workdir='/tmp',
log_path='/tmp/foo'
)
opt = {
'artifact_dir': '/tmp',
'envvars': {
'ANSIBLE_STDOUT_CALLBACK': 'fake.py',
'ANSIBLE_CONFIG': '/tmp/foo/artifacts/ansible.cfg',
'VALIDATIONS_LOG_DIR': '/tmp/foo'},
'extravars': {},
'fact_cache': '/tmp/foo/artifacts/',
'fact_cache_type': 'jsonfile',
'ident': '',
'inventory': 'localhost,',
'playbook': 'existing.yaml',
'private_data_dir': '/tmp',
'project_dir': '/tmp',
'quiet': False,
'rotate_artifacts': 256,
'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)

Loading…
Cancel
Save