From c941ef307cdcc413e789c3eea2c27202fa679370 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Thu, 11 Sep 2025 22:33:47 +0200 Subject: [PATCH] jwutils.ldap: Introduce 'password' alias for 'bind_pw' jw-client-devops configures its databases with a set of config keys which are identical - except for the 'bind_pw' key, which is called 'password'. Allow that, too. Signed-off-by: Jan Lindemann --- tools/python/jwutils/ldap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/python/jwutils/ldap.py b/tools/python/jwutils/ldap.py index d8d9946..6728644 100644 --- a/tools/python/jwutils/ldap.py +++ b/tools/python/jwutils/ldap.py @@ -42,7 +42,10 @@ class Config: @property def bind_pw(self): if self.__bind_pw is None: - ret = self.__get('bind_pw', default=None) + for key in ['bind_pw', 'password']: + ret = self.__get(key, default=None) + if ret is not None: + break if ret is None: ldap_secret_file = self.__get('secret_file', f'{pathlib.Path.home()}/.ldap.secret') with open(ldap_secret_file, 'r') as file: