]> Frank Brehm's Git Trees - pixelpark/pp-admin-tools.git/commitdiff
Bugfixing lib/pp_admintools/app/barracuda_sync.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 May 2023 09:32:58 +0000 (11:32 +0200)
committerFrank Brehm <frank.brehm@pixelpark.com>
Wed, 24 May 2023 09:32:58 +0000 (11:32 +0200)
lib/pp_admintools/app/barracuda_sync.py

index db251fca4053b2c713e7b64f28e6a953f069c993..c9a2dd7e8a2927b3670f0a5c0dea01b933ddc8d9 100644 (file)
@@ -17,7 +17,7 @@ from pathlib import Path
 
 # Third party modules
 from fb_tools.argparse_actions import DirectoryOptionAction
-from fb_tools.common import pp
+from fb_tools.common import pp
 from fb_tools.handler import BaseHandler
 from fb_tools.multi_config import DEFAULT_ENCODING
 # from fb_tools.xlate import format_list
@@ -26,7 +26,7 @@ from fb_tools.multi_config import DEFAULT_ENCODING
 from .ldap import BaseLdapApplication
 from ..xlate import XLATOR
 
-__version__ = '0.7.5'
+__version__ = '0.7.6'
 LOG = logging.getLogger(__name__)
 
 _ = XLATOR.gettext
@@ -281,7 +281,7 @@ class BarracudaSyncApp(BaseLdapApplication):
                 continue
             m = self.re_pf_config.match(line)
             if m and m.group('key') == 'virtual_alias_maps':
-                values =  m.group('value')
+                values = m.group('value')
                 for mapping in self.re_pf_valsep.split(values):
                     if self.verbose > 1:
                         LOG.debug(_('Evaluating mapping {!r}.').format(mapping))
@@ -330,7 +330,7 @@ class BarracudaSyncApp(BaseLdapApplication):
         if not m:
             msg = _('Could not evaluate virtual alias mapping {!r}.').format(mapping)
             LOG.error(msg)
-            self.virtalias_mappings.remove(va_file)
+            self.virtalias_mappings.remove(mapping)
             return
 
         table_type = m.group('table_type')
@@ -343,7 +343,7 @@ class BarracudaSyncApp(BaseLdapApplication):
         if not va_file.exists() or not va_file.is_file():
             msg = _('Virtual alias mapping file {!r} does not exists.').format(str(va_file))
             LOG.error(msg)
-            self.virtalias_mappings.remove(va_file)
+            self.virtalias_mappings.remove(mapping)
             return
 
         db_file = va_file.parent / (va_file.name + db_extension)
@@ -351,7 +351,7 @@ class BarracudaSyncApp(BaseLdapApplication):
             LOG.error(_(
                 'DB file for virtual aliases {!r} does not exists or is not a regular '
                 'file.').format(str(db_file)))
-            self.virtalias_mappings.remove(va_file)
+            self.virtalias_mappings.remove(mapping)
             return
 
         mtime_db_file = db_file.stat().st_mtime