mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
users: Avoid test error if ldapsearch is not available
ldapsearch is provided by ldap-utils, which is not a build dependency. Test: Build package using `gbp buildpackage`. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
7cf166e558
commit
d69a36c25f
@ -24,10 +24,13 @@ _cleanup_groups = None
|
|||||||
|
|
||||||
def _is_ldap_set_up():
|
def _is_ldap_set_up():
|
||||||
"""Return whether LDAP is set up."""
|
"""Return whether LDAP is set up."""
|
||||||
return subprocess.call([
|
try:
|
||||||
'ldapsearch', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-b',
|
return subprocess.call([
|
||||||
'ou=groups,dc=thisbox'
|
'ldapsearch', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-b',
|
||||||
]) == 0
|
'ou=groups,dc=thisbox'
|
||||||
|
]) == 0
|
||||||
|
except FileNotFoundError:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
pytestmark = [
|
pytestmark = [
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user