You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running ansible-lint outside a Git repository with --exclude results in a TypeError: sequence item 0: expected str instance, PosixPath found error.
Context: We are running ansible-lint in GitLab CI in a Docker image without Git installed, this causes the code-path for "running outside Git" to be run which fails when combined with --exclude (CI log).
Run ansible-lint outside a Git repository with --exclude
Desired Behaviour
ansible-lint should do its thing and don't explode.
Actual Behaviour
$ cd /
$ ansible-lint --exclude 123
Traceback (most recent call last):
File "/usr/bin/ansible-lint", line 33, in<module>
sys.exit(load_entry_point('ansible-lint==5.0.9', 'console_scripts', 'ansible-lint')())
File "/usr/lib/python3.9/site-packages/ansiblelint/__main__.py", line 283, in _run_cli_entrypoint
sys.exit(main(sys.argv))
File "/usr/lib/python3.9/site-packages/ansiblelint/__main__.py", line 220, in main
result = _get_matches(rules, options)
File "/usr/lib/python3.9/site-packages/ansiblelint/runner.py", line 184, in _get_matches
lintables = ansiblelint.utils.get_lintables(options=options, args=options.lintables)
File "/usr/lib/python3.9/site-packages/ansiblelint/utils.py", line 805, in get_lintables
forfilenamein discover_lintables(options):
File "/usr/lib/python3.9/site-packages/ansiblelint/file_utils.py", line 228, in discover_lintables
exclude_pattern = "|".join(options.exclude_paths)
TypeError: sequence item 0: expected str instance, PosixPath found
The text was updated successfully, but these errors were encountered:
Summary
Running
ansible-lint
outside a Git repository with--exclude
results in aTypeError: sequence item 0: expected str instance, PosixPath found
error.Context: We are running
ansible-lint
in GitLab CI in a Docker image without Git installed, this causes the code-path for "running outside Git" to be run which fails when combined with--exclude
(CI log).Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Arch Linux
STEPS TO REPRODUCE
Run
ansible-lint
outside a Git repository with--exclude
Desired Behaviour
ansible-lint
should do its thing and don't explode.Actual Behaviour
The text was updated successfully, but these errors were encountered: