Giter Club home page Giter Club logo

python-slapd's Introduction

python-slapd Documentation Status

Controls your OpenLDAP process in a pythonic way.

pip install slapd
>>> import slapd
>>> process = slapd.Slapd()
>>> process.start()
>>> process.init_tree()
>>> process.ldapwhoami().stdout.decode("utf-8")
'dn:cn=manager,dc=slapd-test,dc=python-ldap,dc=org\n'
>>> process.stop()

Troubleshooting

On distributions like Ubuntu, apparmor may restrict slapd to access some files that python-slapd has generated. This situation can be solved by passing slapd in complain mode:

sudo apt install --yes apparmor-utils
sudo aa-complain /usr/sbin/slapd

python-slapd's People

Contributors

azmeuk avatar sblondon avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

azmeuk

python-slapd's Issues

configuration test failed

On some devices, the README examples raises an exception:

>>> import slapd
>>> process = slapd.Slapd()
>>> process.start()
2021-04-02 15:52:38,587 ERROR 606721a6 ldif_read_file: Permission denied for ".../python-ldap-test-34321/slapd.d/cn=config.ldif"
slaptest: bad configuration directory!

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../env/lib/python3.8/site-packages/slapd/__init__.py", line 389, in start
    self._test_config()
  File ".../env/lib/python3.8/site-packages/slapd/__init__.py", line 335, in _test_config
    raise RuntimeError("configuration test failed")
RuntimeError: configuration test failed

configuration test failed
$ ./env/bin/python --version
Python 3.8.5

$ slapd -V
@(#) $OpenLDAP: slapd  (Ubuntu) (Feb 18 2021 14:22:15) $
	Debian OpenLDAP Maintainers <[email protected]>

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.