-
Notifications
You must be signed in to change notification settings - Fork 16
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
[BUG] - Useless shebangs #81
Comments
Thanks @aueam for your contribution, The shebang is a requirement of Ansible and how Ansible work, the shebang in modules is not useless, even though they are not executable (and were nevert meant to be executable as is). Ansible does some magic packaging before they get transferred to the target and executed, including some module utils which you see in the modules. (AFAIR the shebang will be replaced to whatever ansible_python_interpreter points to) Read more about the requirement https://docs.ansible.com/ansible/latest/dev_guide/developing_modules_documenting.html#python-shebang-utf-8-coding |
Interesting, @resmo. I believe the OTOH, it is easily possible that I'm wrong here, so please could you show us what Thank you. |
In addition, for the |
indeed, ironically there shouldn't be a shebang in an inventory plugin because it's executed on the controller. |
I found this: https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html So it looks like ansible really requires shebang in modules even they are not executable. I think this bug report could be closed. |
Describe the bug
The listed files shouldn't be runnable with python because they have relative imports. But thanks to the shebangs they are runnable, which is wrong because it always throws an error.
listed files:
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/aueam/ansible-collection-vultr.git cd ansible-collection-vultr/plugins/inventory/ chmod +x vultr.py
Expected behavior
I expected them not to be runnable.
Desktop (please complete the following information where applicable:
The text was updated successfully, but these errors were encountered: