New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimum ansible version check fails with stack dump #1378
Comments
This does not appear to fix the crash at all. The undefined variable reference is in the block after the except clause that was modified by the patch at line 52 in the "if failed:" block. So Improve ansible version check #1381 effectively does nothing. It also does not address that the constant name implies that it is the minimum version that is expected to supported, yet the way the check is done by using "<=" instead of "<" will result in that version ansible being blocked from using it. |
Thanks! Reopening now and also rewriting the check as I plan to cover a quite common issue where ansible executable is using a different version of ansible module, something that is very likely to cause confusions and hard to debug issues with the linter. Once done, it will check that both report the same version. |
- assure we check that ansible python module and ansible cli versions are the same - print ansible version alongside ansible-lint version - fix version version comparison from <= to < Fixes: #1378
@JohnMalmberg please review/test the pull-request above, I hope that follow-up sorts the issue for good. |
- assure we check that ansible python module and ansible cli versions are the same - print ansible version alongside ansible-lint version - fix version version comparison from <= to < Fixes: #1378
- assure we check that ansible python module and ansible cli versions are the same - print ansible version alongside ansible-lint version - fix version version comparison from <= to < Fixes: #1378
- assure we check that ansible python module and ansible cli versions are the same - print ansible version alongside ansible-lint version - fix version version comparison from <= to < Fixes: #1378
- assure we check that ansible python module and ansible cli versions are the same - print ansible version alongside ansible-lint version - fix version version comparison from <= to < Fixes: #1378
Summary
See https://github.com/ansible-community/ansible-lint/blob/master/src/ansiblelint/_prerun.py
The "failed" check block at line 45 is referencing the variable "version" which only exists if the except block is thrown.
If the version compare fails this causes a pretty much useless stack trace instead of explaining the version issue.
The version check is also using "<=" instead of "<" for the check, which means that the version set for "ANSIBLE_MIN_VERSION" is not the actual minimum version that will work with the linting program.
This bug appears to have been introduced with ansible-lint 5.0.0.
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Run in a virtualenv on CentOS 7.9
STEPS TO REPRODUCE
ansible-lint --version
ansible-lint --version
Desired Behaviour
ansible-lint --version
ansible-lint 5.0.1
Possible security bugs should be reported via email to
security@ansible.com
Actual Behaviour
Please give some details of what is actually happening.
Include a [minimum complete verifiable example] with:
ansible-playbook --syntax-check playbook
The text was updated successfully, but these errors were encountered: