math.py

I just responded to a closed issue at github, but its a slightly different flavor so I thought I’d mention it here to get some steer.

https://github.com/ansible/ansible/issues/9833

We need to use some of the methods in the python math stdlib in one of our filter plugins. But that’s not working now because there’s a new math.py within ansible.

I can patch it by adding the methods that we need to ansible’s math.py, but there’s no way for me to get to stdlib anymore without really monkeying with PTYHONPATH, or other fragile approaches.

Could / should the ansible module be named something other than math.py?

The minimum python version for ansible on the controller is 2.6. So you can (and actually should to prep for python 3 compat) use

from future import absolute_imports

-Toshio

I just responded to a closed issue at github, but its a slightly different flavor so I thought I’d mention it here to get some steer.

https://github.com/ansible/ansible/issues/9833

We need to use some of the methods in the python math stdlib in one of our filter plugins. But that’s not working now because there’s a new math.py within ansible.

I can patch it by adding the methods that we need to ansible’s math.py, but there’s no way for me to get to stdlib anymore without really monkeying with PTYHONPATH, or other fragile approaches.

Could / should the ansible module be named something other than math.py?

Toshio -

from future import absolute_imports

ended up working just fine, thanks for pointing that out.

  • Mick