mschuchard / linter-ansible-linting

ansible-lint linter for pulsar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ansible-lint 3.3.3 : Cannot import name boolean

AlbanAndrieu opened this issue · comments

Traceback (most recent call last):
File "/usr/local/bin/ansible-lint", line 135, in
sys.exit(main(sys.argv[1:]))
File "/usr/local/bin/ansible-lint", line 101, in main
rules.extend(RulesCollection.create_from_directory(rulesdir))
File "/usr/local/lib/python2.7/dist-packages/ansiblelint/init.py", line 162, in create_from_directory
result.rules = ansiblelint.utils.load_plugins(os.path.expanduser(rulesdir))
File "/usr/local/lib/python2.7/dist-packages/ansiblelint/utils.py", line 95, in load_plugins
mod = imp.load_module(pluginname, fh, filename, desc)
File "/usr/local/lib/python2.7/dist-packages/ansiblelint/rules/CommandsInsteadOfModulesRule.py", line 27, in
from ansible.utils import boolean
ImportError: cannot import name boolean

lsb_release -a
LSB Version: security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
atom --version

Atom : 1.17.2
Electron: 1.3.15
Chrome : 52.0.2743.82
Node : 6.5.0

python -V
Python 2.7.12

ansible-lint --version
ansible-lint 3.3.3

ansible --version
ansible 2.3.0.0
config file = /etc/ansible/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609]

https://github.com/mschuchard/linter-ansible-linting 1.3.0

This is actually an issue with either ansible-lint, python, or your env. However, I do notice your version of ansible-lint is somewhat old. Maybe try updating to 3.4.13 (or current if that is not the current) and see if that fixes the issue for you?

Indeed, upgrading ansible-lint fixed the issue

pip install ansible-lint

ansible-lint --version
ansible-lint 3.4.13

Thanks for the advice