From: Frank Brehm Date: Wed, 17 May 2023 14:54:27 +0000 (+0200) Subject: Completing verifying cmd line parametrers X-Git-Tag: 0.9.0~1^2~47 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=c287f626a34756761ce69ce15cbc7f55aa6c19cd;p=pixelpark%2Fpp-admin-tools.git Completing verifying cmd line parametrers --- diff --git a/lib/pp_admintools/app/barracuda_sync.py b/lib/pp_admintools/app/barracuda_sync.py index e41a975..80185c4 100644 --- a/lib/pp_admintools/app/barracuda_sync.py +++ b/lib/pp_admintools/app/barracuda_sync.py @@ -25,7 +25,7 @@ from fb_tools.xlate import format_list from .ldap import BaseLdapApplication from ..xlate import XLATOR -__version__ = '0.6.2' +__version__ = '0.6.3' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -57,6 +57,8 @@ class BarracudaSyncApp(BaseLdapApplication): 'sdbm': '.pag', } + usable_postfix_hashtypes = ['btree', 'cdb', 'dbm', 'hash', 'lmdb', 'sdbm', 'texthash'] + default_ignore_aliases = ['root', ] default_origin = 'pixelpark.com' @@ -96,6 +98,7 @@ class BarracudaSyncApp(BaseLdapApplication): self.postmap_command = Path('/sbin') / self.default_postmap_command self.lookup_table_types = [] + self.virtaliases_files = [] self.existing_aliases = [] self.ldap_aliases = [] self.aliases_to_create = [] @@ -223,6 +226,23 @@ class BarracudaSyncApp(BaseLdapApplication): LOG.error(msg) self.exit(1) self.postfix_db_hashtype = htype + elif self.postfix_db_hashtype not in self.lookup_table_types: + msg = _('Default lookup table type {!r} is invalid. Valid types are:').format( + self.postfix_db_hashtype) + LOG.error(msg) + self.exit(6) + + if self.args.hashtype not in self.usable_postfix_hashtypes: + msg = _( + 'The lookup table type {!r} cannot be used to get all ' + 'database elements.').format(self.postfix_db_hashtype) + LOG.error(msg) + self.exit(6) + + # ------------------------------------------------------------------------- + def _init_virtaliases_files(self): + """Collect all files used as database for virtual aliases.""" + pass # ------------------------------------------------------------------------- def _check_virtaliases_files(self):