Skip to content

Commit

Permalink
Handle parse exceptions carefully on checking sslmng output
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mikhail Sandakov committed Mar 29, 2024
1 parent 3ba57dc commit 6d9076a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pleskdistup/actions/emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 6d9076a

Please sign in to comment.