Skip to content
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

ansible-lint print WARNING (PATH altered to include) #2357

Closed
hardcore opened this issue Aug 29, 2022 · 5 comments · Fixed by #2477
Closed

ansible-lint print WARNING (PATH altered to include) #2357

hardcore opened this issue Aug 29, 2022 · 5 comments · Fixed by #2477
Labels
bug new Triage required

Comments

@hardcore
Copy link

Summary

ansible-lint --version print:

WARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/6.5.1/libexec/bin
ansible-lint 6.5.1 using ansible 2.13.3

Issue Type
  • Bug Report
Ansible and Ansible Lint details
❯ ansible-lint --version
WARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/6.5.1/libexec/bin
ansible-lint 6.5.1 using ansible 2.13.3
ansible --version
ansible [core 2.13.3]
  config file = None
  configured module search path = ['/Users/sash/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/lib/python3.9/site-packages/ansible
  ansible collection location = /Users/sash/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.9.13 (main, Aug 11 2022, 13:40:36) [Clang 13.1.6 (clang-1316.0.21.2.5)]
  jinja version = 3.1.2
  libyaml = True

ansible-lint --version
WARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/6.5.1/libexec/bin
ansible-lint 6.5.1 using ansible 2.13.3

brew --version
Homebrew 3.5.10
Homebrew/homebrew-core (git revision c85c8882a61; last commit 2022-08-29)
Homebrew/homebrew-cask (git revision b422fa8bf7; last commit 2022-08-29)
  • ansible installation method: homebrew
  • ansible-lint installation method: homebrew
OS / ENVIRONMENT

macOS Monterey Version 12.5.1, MacBook Pro (14", 2021)

STEPS TO REPRODUCE

Run ansible-lint within a homebrew installation.

Desired Behavior

This behavior should be fixed in #2129

Actual Behavior

ansible-lint thorws an error.

@ssbarnea
Copy link
Member

ssbarnea commented Sep 1, 2022

I use homebrew too. The real question is how did you install ansible-lint?

@dawidd6
Copy link

dawidd6 commented Sep 9, 2022

ansible installation method: homebrew
ansible-lint installation method: homebrew

Can confirm on Ubuntu with Homebrew-installed ansible and ansible-lint:

Fri 09 Sep 11:10:31 ➜  ~  which ansible
/home/linuxbrew/.linuxbrew/bin/ansible
Fri 09 Sep 11:10:34 ➜  ~  which ansible-lint
/home/linuxbrew/.linuxbrew/bin/ansible-lint
Fri 09 Sep 11:10:37 ➜  ~  ansible-lint --version
WARNING: PATH altered to include /home/linuxbrew/.linuxbrew/Cellar/ansible-lint/6.5.2/libexec/bin
ansible-lint 6.5.2 using ansible 2.13.3

@nemccarthy
Copy link

Getting a similar error with ansible-lint and ansible installved via homebrew. Seeing in the Ansible Server in VS code the following warning: path altered to include /usr/local/opt/python@3.10/bin even though python was started from /usr/local/bin/python3

Looks like the logic in ansible-lint isnt checking for sym-links in PATH as it calls sys.executable which returns the root dir...

ssbarnea added a commit to ssbarnea/ansible-lint that referenced this issue Sep 21, 2022
As it is quite common for many users to miss adding python bin scripts
folder to their PATH, even if pip does warn them about the issue, we
now add it dynamically.

Fixes: ansible#2357
ssbarnea added a commit to ssbarnea/ansible-lint that referenced this issue Sep 21, 2022
As it is quite common for many users to miss adding python bin scripts
folder to their PATH, even if pip does warn them about the issue, we
now add it dynamically.

Fixes: ansible#2357
@ssbarnea
Copy link
Member

@hardcore @nemccarthy @dawidd6 Can you quickly test #2477 is sorting the problem for you?

ssbarnea added a commit that referenced this issue Sep 21, 2022
As it is quite common for many users to miss adding python bin scripts
folder to their PATH, even if pip does warn them about the issue, we
now add it dynamically.

Fixes: #2357
davedittrich pushed a commit to davedittrich/ansible-lint that referenced this issue Sep 27, 2022
As it is quite common for many users to miss adding python bin scripts
folder to their PATH, even if pip does warn them about the issue, we
now add it dynamically.

Fixes: ansible#2357
@remyleone
Copy link

Still got the same problem. I installed ansible-lint with homebrew too.

$ ansible-lint -L
WARNING: PATH altered to include /opt/homebrew/Cellar/ansible-lint/24.9.2_1/libexec/bin, /opt/homebrew/Cellar/ansible-lint/24.9.2_1/libexec/bin :: This is usually a sign of broken local setup, which can cause unexpected behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new Triage required
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants