Clarify CLI version number as core version (#72287)

* clarify CLI version number as core version

* reduce confusion with `ansible` PyPI package >= 2.10 drifting from core version

* fix units
pull/73751/head
Matt Davis 3 years ago committed by GitHub
parent 920b68f5f2
commit d0e991e892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
minor_changes:
- CLI version displays clarified as core version

@ -157,7 +157,7 @@ def _gitinfo():
def version(prog=None):
""" return ansible version """
if prog:
result = [" ".join((prog, __version__))]
result = ["{0} [core {1}] ".format(prog, __version__)]
else:
result = [__version__]

@ -25,7 +25,7 @@ VERSION_OUTPUT = opt_help.version(prog=FAKE_PROG)
@pytest.mark.parametrize(
'must_have', [
FAKE_PROG + u' %s' % ansible_version,
FAKE_PROG + u' [core %s]' % ansible_version,
u'config file = %s' % C.CONFIG_FILE,
u'configured module search path = %s' % cpath,
u'ansible python module location = %s' % ':'.join(ansible_path),

@ -105,7 +105,7 @@ def test_ansible_version(capsys, mocker):
version_lines = version[0].splitlines()
assert len(version_lines) == 9, 'Incorrect number of lines in "ansible --version" output'
assert re.match('ansible [0-9.a-z]+(?: .*)?$', version_lines[0]), 'Incorrect ansible version line in "ansible --version" output'
assert re.match(r'ansible \[core [0-9.a-z]+\]', version_lines[0]), 'Incorrect ansible version line in "ansible --version" output'
assert re.match(' config file = .*$', version_lines[1]), 'Incorrect config file line in "ansible --version" output'
assert re.match(' configured module search path = .*$', version_lines[2]), 'Incorrect module search path in "ansible --version" output'
assert re.match(' ansible python module location = .*$', version_lines[3]), 'Incorrect python module location in "ansible --version" output'

Loading…
Cancel
Save