From 06971bb7cac8a8031d78501d1081de301a74fe70 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Tue, 22 Aug 2023 13:55:40 +0200 Subject: [PATCH] Better initialisation of the LdapPasswordHandler class. --- lib/pp_admintools/app/check_ldap_pwd_schemes.py | 3 +-- lib/pp_admintools/app/mk_ldap_passwd.py | 4 +--- lib/pp_admintools/app/set_ldap_password.py | 4 +--- lib/pp_admintools/handler/ldap_password.py | 6 +++++- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/pp_admintools/app/check_ldap_pwd_schemes.py b/lib/pp_admintools/app/check_ldap_pwd_schemes.py index 3c6d5be..166f326 100644 --- a/lib/pp_admintools/app/check_ldap_pwd_schemes.py +++ b/lib/pp_admintools/app/check_ldap_pwd_schemes.py @@ -32,7 +32,7 @@ from ..config.ldap import LdapConfiguration from ..handler.ldap_password import LdapPasswordHandler from ..xlate import XLATOR -__version__ = '0.2.1' +__version__ = '0.2.2' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -63,7 +63,6 @@ class CheckLdapPwdSchemesApplication(BaseLdapApplication): # ------------------------------------------------------------------------- def __init__(self, appname=None, base_dir=None): """Initialize the CheckLdapPwdSchemesApplication object.""" - LdapPasswordHandler.init_pass_schemes() self.ldap = None self.instance = None self.connect_info = None diff --git a/lib/pp_admintools/app/mk_ldap_passwd.py b/lib/pp_admintools/app/mk_ldap_passwd.py index 57a968d..c98a59d 100644 --- a/lib/pp_admintools/app/mk_ldap_passwd.py +++ b/lib/pp_admintools/app/mk_ldap_passwd.py @@ -24,7 +24,7 @@ from ..handler.ldap_password import WrongRoundsError from ..handler.ldap_password import WrongSaltError from ..xlate import XLATOR -__version__ = '0.1.3' +__version__ = '0.1.4' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -47,8 +47,6 @@ class MkLdapPasswdApplication(BaseApplication): # ------------------------------------------------------------------------- def __init__(self, appname=None, base_dir=None): """Initialize this application object.""" - LdapPasswordHandler.init_pass_schemes() - self.password = None self.no_cracklib = False diff --git a/lib/pp_admintools/app/set_ldap_password.py b/lib/pp_admintools/app/set_ldap_password.py index fc30199..6a9c5b4 100644 --- a/lib/pp_admintools/app/set_ldap_password.py +++ b/lib/pp_admintools/app/set_ldap_password.py @@ -35,7 +35,7 @@ from ..handler.ldap_password import WrongRoundsError from ..handler.ldap_password import WrongSaltError from ..xlate import XLATOR -__version__ = '0.8.2' +__version__ = '0.8.3' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -70,8 +70,6 @@ class SetLdapPasswordApplication(BaseLdapApplication): # ------------------------------------------------------------------------- def __init__(self, appname=None, base_dir=None): """Initialize the SetLdapPasswordApplication object.""" - LdapPasswordHandler.init_pass_schemes() - self.current_password = None self.need_current_password = False self.current_password_hash = None diff --git a/lib/pp_admintools/handler/ldap_password.py b/lib/pp_admintools/handler/ldap_password.py index a596862..d1ca614 100644 --- a/lib/pp_admintools/handler/ldap_password.py +++ b/lib/pp_admintools/handler/ldap_password.py @@ -36,7 +36,7 @@ LOG = logging.getLogger(__name__) _ = XLATOR.gettext ngettext = XLATOR.ngettext -__version__ = '0.4.0' +__version__ = '0.4.1' # ============================================================================= @@ -490,6 +490,10 @@ class LdapPasswordHandler(HandlingObject): return 'CRYPT (unknown {!r})'.format(crypt_id) +# ============================================================================= +# Init of failing class data +LdapPasswordHandler.init_pass_schemes() + # ============================================================================= if __name__ == '__main__': -- 2.39.5