From: Frank Brehm Date: Tue, 23 May 2023 16:12:08 +0000 (+0200) Subject: Get local virtual aliases. X-Git-Tag: 0.9.0~1^2~36 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=86b12aeab1de3fda0d0eb851518f7a477bfaa636;p=pixelpark%2Fpp-admin-tools.git Get local virtual aliases. --- diff --git a/lib/pp_admintools/app/barracuda_sync.py b/lib/pp_admintools/app/barracuda_sync.py index 6805d0a..071e275 100644 --- a/lib/pp_admintools/app/barracuda_sync.py +++ b/lib/pp_admintools/app/barracuda_sync.py @@ -26,7 +26,7 @@ from fb_tools.xlate import format_list from .ldap import BaseLdapApplication from ..xlate import XLATOR -__version__ = '0.7.0' +__version__ = '0.7.1' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -330,6 +330,22 @@ class BarracudaSyncApp(BaseLdapApplication): """Reading virtual aliases from given file.""" LOG.info(_("Reading in from virtual alias file {!r} ...").format(str(va_file))) + handler = BaseHandler(appname=self.appname, verbose=self.verbose) + pdata = handler.call([str(self.postmap_command), '-s', str(va_file)], quiet=True) + + if pdata.returncode > 0: + msg = _('Error {rc} on getting virtual aliases from {va!r}').format( + rc=pdata.returncode, va=str(va_file)) + if pdata.stderr: + msg += ': ' + pdata.stderr + else: + msg += '.' + LOG.err(msg) + self.exit(6) + + if self.verbose > 2: + LOG.debug(_('Result:') + '\n' + str(pdata)) + # ------------------------------------------------------------------------- def _run(self):