diff --git a/roles/ipaclient/files/py3test.py b/roles/ipaclient/files/py3test.py new file mode 100644 index 0000000000000000000000000000000000000000..d370b6870ab5a1be8e25ea7fd0abe4243f4fcd3d --- /dev/null +++ b/roles/ipaclient/files/py3test.py @@ -0,0 +1,9 @@ +#!/usr/bin/python3 + +# Test ipaclient python3 binding +from ipaclient.install.client import SECURE_PATH + +# Check ipapython version to be >= 4.6 +from ipapython.version import NUM_VERSION, VERSION +if NUM_VERSION < 40600: + raise Exception("ipa %s not usable with python3" % VERSION) diff --git a/roles/ipaclient/tasks/python_2_3_test.yml b/roles/ipaclient/tasks/python_2_3_test.yml index 04270496c729975c0749961182f66401cb41cee7..08af26491d87e1cd38f17ebaee4a9e25a6b154c0 100644 --- a/roles/ipaclient/tasks/python_2_3_test.yml +++ b/roles/ipaclient/tasks/python_2_3_test.yml @@ -1,6 +1,6 @@ - block: - name: Verify Python3 import - command: python3 -c "from ipapython.version import NUM_VERSION" + script: py3test.py register: py3test failed_when: False