From 6d9076a01a4eec50150379d568d35290f049c36d Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Thu, 28 Mar 2024 14:10:30 +0200 Subject: [PATCH] Handle parse exceptions carefully on checking sslmng output In some cases sslmng output could skip parameters for specific services. Usually it happens when ssl related parameters was not specifically changed for a service. This situation is fine, so we should just skip the DH parameters increase action in this case. --- pleskdistup/actions/emails.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pleskdistup/actions/emails.py b/pleskdistup/actions/emails.py index 28dc4fa..48c7938 100644 --- a/pleskdistup/actions/emails.py +++ b/pleskdistup/actions/emails.py @@ -32,6 +32,12 @@ def _is_required(self) -> bool: except json.JSONDecodeError: log.warn(f"Failed to parse plesk sslmng results: {proc.stdout}") return False + except KeyError as e: + log.warn(f"There is no parameter '{e}' in the sslmng output.") + return False + except Exception as e: + log.warn(f"Failed to check sslmng configuration for dovecot: {e}. Type is {type(e)}") + raise e return True