Skip to content

plugins(module): fix shebang found by ansible-sanity - #141

Open
alagoutte wants to merge 2 commits into
codeaffen:developfrom
alagoutte:ansible-sanity-shebang
Open

plugins(module): fix shebang found by ansible-sanity#141
alagoutte wants to merge 2 commits into
codeaffen:developfrom
alagoutte:ansible-sanity-shebang

Conversation

@alagoutte

@alagoutte alagoutte commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Wenn running ansible-test sanity the following error messages showing issues with the configured shabang:

ERROR: plugins/modules/address.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/device.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/device_type.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/domain.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/folder.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/location.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/nameserver.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/section.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/subnet.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/tag.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/vlan.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/vrf.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'

This fix should enable the code to pass sanity checks.

ERROR: plugins/modules/address.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/device.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/device_type.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/domain.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/folder.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/location.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/nameserver.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/section.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/subnet.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/tag.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/vlan.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
ERROR: plugins/modules/vrf.py:1:1: expected module shebang "b'#!/usr/bin/python'" but found: b'#!/usr/bin/env python'
@cmeissner

Copy link
Copy Markdown
Member

Please see #127, this is not a bug and will not be changed in any way in our codebase.

@cmeissner cmeissner closed this Aug 4, 2026
@cmeissner cmeissner added invalid This doesn't seem right wontfix This will not be worked on labels Aug 4, 2026
@alagoutte

Copy link
Copy Markdown
Contributor Author

Ok, understand but it is for fix ansible sanity shebang test -> https://docs.ansible.com/projects/ansible-core/devel/dev_guide/testing/sanity/shebang.html

but we can ignore if you prefer

@cmeissner

Copy link
Copy Markdown
Member

@alagoutte I see the need for having #!/usr/bin/python in Ansible modules, but as we make strong use of Python virtual environments, you should check if changing the shebang did not break a development environment with an enabled pyenv or venv.

@cmeissner cmeissner reopened this Aug 12, 2026
@cmeissner cmeissner removed invalid This doesn't seem right wontfix This will not be worked on labels Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants