[BUG] ldap3 module not ready for python3
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
I was expecting the ldap3 module using the ldap3 python library. Instead, it depends on the same ldap module as (ext) pillar_ldap, which is not existent for setups with python3 (see #58760).
Setup
Ubuntu salt-master/minion with python3-ldap3 module installed.
Steps to Reproduce the behavior
# apt install python3-ldap3
# systemctl restart salt-master
# systemctl restart salt-minion
# salt-call ldap3.search "{}"
'ldap3' __virtual__ returned False
Expected behavior
'ldap3' virtual must return True (while this would not be visible in the console output, but some other errors appearing because no arguments being provided).
Screenshots
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Salt Version:
Salt: 3002.2
Dependency Versions:
cffi: 1.5.2
cherrypy: 3.5.0
dateutil: 2.4.2
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
Jinja2: 2.8
libgit2: 0.24.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: 2.14
pycrypto: Not Installed
pycryptodome: 3.4.7
pygit2: 0.24.0
Python: 3.5.2 (default, Oct 7 2020, 17:19:02)
python-gnupg: 0.3.8
PyYAML: 5.3.1
PyZMQ: 17.1.2
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.1.4
System Versions:
dist: ubuntu 16.04 Xenial Xerus
locale: UTF-8
machine: x86_64
release: 4.4.0-197-generic
system: Linux
version: Ubuntu 16.04 Xenial Xerus
Additional context
If you like to close this bug as duplicate, I'm fine with it, I just want to contribute by showing that there are use cases. In this case, I like to work on the list of ldap users to execute some salt magic (e.g. creating user homes).
I'm failing with all ldap modules provided by saltstack when using python3. Please upgrade or remove (literally) them; While I don't expect ldap modules being present, I expect them to work if they are, and I'm really happy to help to fix minor issues on them.
I'm happy to test new versions and also to supply simple patches, but unable to migrate one of them to python3 by myself due to limited time resources. Thanks everyone for your efforts put into Saltstack!
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ldap3 execution module's virtual entry point and reproduce the failure with salt-call ldap3.search "{}" under Python 3. Compare its dependency handling with ext pillar_ldap and the related issue #58760. Done means virtual returns True when python3-ldap3 is installed, allowing the ldap3 search command to proceed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100