Community Packages

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#42941 - [ansible] packaging / python interpreter problem

Attached to Project: Community Packages
Opened by George Angelopoulos (l4than-d3vers) - Friday, 28 November 2014, 15:03 GMT
Last edited by Bartłomiej Piotrowski (Barthalion) - Thursday, 04 December 2014, 19:46 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 2
Private No

Details

Description:

Modules use the wrong python interpreter in the shebang.
See the following github issue for details:
https://github.com/ansible/ansible/issues/9649#issuecomment-64900971
This task depends upon

Closed by  Bartłomiej Piotrowski (Barthalion)
Thursday, 04 December 2014, 19:46 GMT
Reason for closing:  Fixed
Additional comments about closing:  ansible 1.8.1-2
Comment by Scott (firecat53) - Friday, 28 November 2014, 19:00 GMT
Files I found with the wrong shebang:

/usr/lib/python2.7/site-packages/ansible/modules/extras/packaging/os/swdepot.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/extras/packaging/os/pacman.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/extras/packaging/os/urpmi.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/extras/packaging/os/zypper.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/extras/network/lldp.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/core/packaging/os/yum.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/core/packaging/os/apt_rpm.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/core/cloud/rackspace/rax_cdb_user.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/core/cloud/rackspace/rax_cdb.py:1:#!/usr/bin/python -tt
/usr/lib/python2.7/site-packages/ansible/modules/core/cloud/rackspace/rax_cdb_database.py:1:#!/usr/bin/python -tt

Thanks!
Scott
Comment by Doug Newgard (Scimmia) - Friday, 28 November 2014, 19:57 GMT
@firecat53, the shebang *SHOULD* be #!/usr/bin/python
Comment by Scott (firecat53) - Friday, 28 November 2014, 20:10 GMT
It's been #!/usr/bin/python2 throughout the 1.7.x series and all the rest of the shebangs are python2 as well. Per their documentation, ansible isn't supporting Python 3 yet.

Scott
Comment by George Angelopoulos (l4than-d3vers) - Friday, 28 November 2014, 20:42 GMT
@Scott

Yes, this confused me as well and I still don't completely understand the issue.

But, @bcoca on github says it should be `#!/usr/bin/python` and my test confirms that.
Comment by Scott (firecat53) - Friday, 28 November 2014, 21:24 GMT
Ah, maybe I'm thinking about it incorrectly. I think the modules are actually executed on the nodes, not on the host, thus the need for the ansible_python_interpreter variable. Sorry for the noise.

I thought this may have been the cause of my error when running '$ ansible' with 1.8.1:

Traceback (most recent call last):
File "/usr/bin/ansible", line 191, in <module>
cli = Cli()
File "/usr/bin/ansible", line 41, in __init__
if C.DEFAULT_LOAD_CALLBACK_PLUGINS:
AttributeError: 'module' object has no attribute 'DEFAULT_LOAD_CALLBACK_PLUGINS'

Perhaps not? I can open a separate bug report if this looks like a different issue.

Thanks,
Scott

Edit: <facepalm> I'm very sorry...I had attempted a 'pip install --user ansible' at one point and had some leftovers in ~/.local/lib/python2.7/site-packages/ansible. Everything works fine now after removing that directory.
Comment by Daniel Wendler (BMRMorph) - Thursday, 04 December 2014, 08:52 GMT
Ok, same problem here, with package from community i got the "/bin/sh: /usr/bin/python2:" Datei oder Verzeichnis nicht gefunden" error
So i've rebuild the package with following editions:

--- PKGBUILD 2014-12-04 00:06:30.146255130 +0100
+++ PKGBUILD_dwe 2014-12-04 09:38:03.178605838 +0100
@@ -21,9 +21,9 @@
source=(http://releases.ansible.com/ansible/$pkgname-$pkgver.tar.gz)
sha256sums=('b08129cb4fe20dfc33403cc7245ea2c95999fdb9922fed7f06d4ba51ba8528b1')

-prepare() {
- find $pkgname-$pkgver -type f -name \*.py -exec sed -i '1s:python$:&2:' {} +
-}
+#prepare() {
+# find $pkgname-$pkgver -type f -name \*.py -exec sed -i '1s:python$:&2:' {} +
+#}

build() {
cd $pkgname-$pkgver

After that i can run it without errors.

Loading...