ServiceNowITOM / ansible-sn-inventory

Ansible Dynamic Inventory for ServiceNow
Apache License 2.0
79 stars 45 forks source link

Python 3 support? #1

Closed klauern closed 7 years ago

klauern commented 7 years ago

With Ansible having a technical preview of Python 3 support, will this module be updated to support that as well?

amittell commented 7 years ago

Haven't investigated yet, but yes I plan to update when I get some time to test, if you get to it first please update the thread with your findings.

amittell commented 7 years ago

Test output:

(py3-ansible) [mittell:...nsible/ansible-sn-inventory]$ ansible --version (master) ansible 2.3.2.0 config file = configured module search path = Default w/o overrides python version = 3.6.2 (default, Jul 17 2017, 16:44:45) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] (py3-ansible) [mittell:...nsible/ansible-sn-inventory]$ ./now.py | jq 'del(._meta) | keys[]' (master) "esx_server" "linux_server" "os_x_server" "solaris_server" "storage_server" "windows_server" (py3-ansible) [mittell:...nsible/ansible-sn-inventory]$ ansible -i now.py esx_server -m ping --list-hosts (master✱) hosts (4): 10.196.33.175 10.196.39.11 10.196.39.12 208.91.197.27

amittell commented 7 years ago

Regression test for Python 2.7.3:

(py3-ansible) [mittell:...nsible/ansible-sn-inventory]$ ansible --version (master✱) ansible 2.3.2.0 config file = configured module search path = Default w/o overrides python version = 2.7.13 (default, Jul 18 2017, 09:17:00) [GCC 4.2.1 Compatible Apple LLVM 8.1.0 (clang-802.0.42)] (py3-ansible) [mittell:...nsible/ansible-sn-inventory]$ ansible -i nowpy3.py esx_server -m ping --list-hosts (master✱) hosts (4): 10.196.33.175 10.196.39.11 10.196.39.12 208.91.197.27

amittell commented 7 years ago

Tested confirmed functional on Ansible 2.3.2 w/Python 2.7.13 and Python 3.6.2.