quinot / ansible-plugin-lookup_ldap

Ansible LDAP lookup plugin
50 stars 16 forks source link

Support for python3 #30

Open markfaine opened 5 years ago

markfaine commented 5 years ago

I keep getting an error when attempting to use with python 3.7.2:

  The full traceback is:
    Traceback (most recent call last):
      File "/home/mfaine/.virtualenvs/ansible/lib/python3.7/site-packages/ansible/executor/task_executor.py", line 98, in run
        items = self._get_loop_items()
      File "/home/mfaine/.virtualenvs/ansible/lib/python3.7/site-packages/ansible/executor/task_executor.py", line 232, in _get_loop_items
        mylookup = self._shared_loader_obj.lookup_loader.get(self._task.loop_with, loader=self._loader, templar=templar)
      File "/home/mfaine/.virtualenvs/ansible/lib/python3.7/site-packages/ansible/plugins/loader.py", line 378, in get
        self._module_cache[path] = self._load_module_source(name, path)
      File "/home/mfaine/.virtualenvs/ansible/lib/python3.7/site-packages/ansible/plugins/loader.py", line 357, in _load_module_source
        module = imp.load_source(full_name, path, module_file)
      File "/home/mfaine/.virtualenvs/ansible/lib/python3.7/imp.py", line 171, in load_source
        module = _load(spec)
      File "<frozen importlib._bootstrap>", line 696, in _load
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 724, in exec_module
      File "<frozen importlib._bootstrap_external>", line 860, in get_code
      File "<frozen importlib._bootstrap_external>", line 791, in source_to_code
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/mnt/c/Users/mfaine/projects/ansible/roles/ldap_lookup/lookup_plugins/ldap.py", line 145
        except Exception, e:
                        ^
    SyntaxError: invalid syntax

    fatal: [instance-1]: FAILED! => {
        "msg": "Unexpected failure during module execution."
    }

I'm thinking maybe there is no python 3 support?

k0ste commented 5 years ago

@markfaine #26