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
Execute ansible-lint on a system where git is not installed.
Desired Behaviour
Ansible-lint works fine, except for the features that require VCS awareness like --progressive
Actual Behaviour
Ansible-lint throws an exception when it fails to locate git:
ansible-lint --exclude molecule -x yaml
Traceback (most recent call last):
File "/builds/sio/server_common/venv/bin/ansible-lint", line 8, in <module>
sys.exit(_run_cli_entrypoint())
File "/builds/sio/server_common/venv/lib/python3.7/site-packages/ansiblelint/__main__.py", line 268, in _run_cli_entrypoint
sys.exit(main(sys.argv))
File "/builds/sio/server_common/venv/lib/python3.7/site-packages/ansiblelint/__main__.py", line 169, in main
initialize_options(argv[1:])
File "/builds/sio/server_common/venv/lib/python3.7/site-packages/ansiblelint/__main__.py", line 75, in initialize_options
new_options = cli.get_config(arguments)
File "/builds/sio/server_common/venv/lib/python3.7/site-packages/ansiblelint/cli.py", line 377, in get_config
options.config_file or f"{guess_project_dir()}/.ansiblelint"
File "/builds/sio/server_common/venv/lib/python3.7/site-packages/ansiblelint/file_utils.py", line 226, in guess_project_dir
check=False,
File "/usr/lib/python3.7/subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'git': 'git'
Summary
Ansible-lint fails if git binary is not present on the machine. This is new behavior in 5.0.3, 5.0.2 was working fine.
Issue Type
Ansible and Ansible Lint details
OS / ENVIRONMENT
Docker container based on debian:10-slim
STEPS TO REPRODUCE
Execute
ansible-lint
on a system wheregit
is not installed.Desired Behaviour
Ansible-lint works fine, except for the features that require VCS awareness like
--progressive
Actual Behaviour
Ansible-lint throws an exception when it fails to locate git:
Full log here: https://gitlab.com/sio/server_common/-/jobs/1088829855#L327
The text was updated successfully, but these errors were encountered: