mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 22:33:00 -04:00
Add simple config_test implementation.
This commit is contained in:
parent
4d24eb83a8
commit
c43602c908
1 changed files with 6 additions and 1 deletions
|
|
@ -364,7 +364,6 @@ class PostfixConfigGenerator:
|
|||
be quickly reversed in the future (challenges)
|
||||
:raises .PluginError: when save is unsuccessful
|
||||
"""
|
||||
|
||||
self.maybe_add_config_lines()
|
||||
|
||||
def rollback_checkpoints(self, rollback=1):
|
||||
|
|
@ -389,6 +388,12 @@ class PostfixConfigGenerator:
|
|||
"""Make sure the configuration is valid.
|
||||
:raises .MisconfigurationError: when the config is not in a usable state
|
||||
"""
|
||||
if os.geteuid() != 0:
|
||||
rc = os.system('sudo /usr/sbin/postfix check')
|
||||
else:
|
||||
rc = os.system('/usr/sbin/postfix check')
|
||||
if rc != 0:
|
||||
raise Exception('MisconfigurationError: Postfix failed self-check.')
|
||||
|
||||
def restart(self):
|
||||
"""Restart or refresh the server content.
|
||||
|
|
|
|||
Loading…
Reference in a new issue