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

hardcoded python3 is used as executable instead of ansible.python.interpreterPath #1140

Open
zalent opened this issue Dec 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working new

Comments

@zalent
Copy link

zalent commented Dec 14, 2023

Summary

There is ansible.python.interpreterPath setting but it's not getting used. There are multiple hardcoded python3 executables launches which should not be used when ansible.python.interpreterPath is set.
Few examples:
https://github.com/ansible/ansible-language-server/blob/75a39bb16eb3b8767d7d719d61fb13b2c86f6215/src/services/ansibleConfig.ts#L85
https://github.com/ansible/ansible-language-server/blob/75a39bb16eb3b8767d7d719d61fb13b2c86f6215/src/utils/getAnsibleMetaData.ts#L114
https://github.com/ansible/ansible-language-server/blob/75a39bb16eb3b8767d7d719d61fb13b2c86f6215/src/utils/getAnsibleMetaData.ts#L128
https://github.com/ansible/ansible-language-server/blob/75a39bb16eb3b8767d7d719d61fb13b2c86f6215/src/utils/commandRunner.ts#L37

Extension version

2.9.118

VS Code version

1.86.0

Ansible Version

❯ ansible --version
ansible [core 2.16.0]
  config file = None
  configured module search path = ['/home/ans/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ans/.local/lib/python3.11/site-packages/ansible
  ansible collection location = /home/ans/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ans/.local/bin/ansible
  python version = 3.11.5 (main, Sep  7 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3.11)
  jinja version = 3.1.2
  libyaml = True

OS / Environment

Win 11 WSL2 Centos 9 Stream Python 3.11, default system python3 points to python3.9

Relevant log output

Ansible meta data
ansible information:

core version: 2.16.0

location: ~/.local/lib/python3.11/site-packages/ansible

config file path: /mnt/c/Users/ans/AppData/Local/Programs/Microsoft VS Code Insiders/None

collections location:

~/.ansible/collections
/usr/share/ansible/collections
/usr/lib64/python39.zip
/usr/lib64/python3.9
/usr/lib64/python3.9/lib-dynload
~/.local/lib/python3.9/site-packages
/usr/lib64/python3.9/site-packages
/usr/lib/python3.9/site-packages
modules location:

~/.ansible/plugins/modules
/usr/share/ansible/plugins/modules
~/.local/lib/python3.11/site-packages/ansible/modules
default host list path:

/etc/ansible/hosts
python information:

version: 3.9.18

location: /usr/bin/python3

ansible-lint information:

version: 6.22.1
@zalent zalent added bug Something isn't working new labels Dec 14, 2023
@ssbarnea ssbarnea transferred this issue from ansible/ansible-language-server Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new
Projects
Status: Roadmap
Development

No branches or pull requests

2 participants