diff --git a/pleskdistup/actions/emails.py b/pleskdistup/actions/emails.py index 48c7938..39632a1 100644 --- a/pleskdistup/actions/emails.py +++ b/pleskdistup/actions/emails.py @@ -82,7 +82,7 @@ def _post_action(self) -> action.ActionResult: path_to_backup = os.path.join(self.temp_directory, "dovecot.conf.bak") if os.path.exists(self.dovecot_config_path): shutil.copy(self.dovecot_config_path, path_to_backup) - motd.add_finish_ssh_login_message(f"The dovecot configuration '{self.dovecot_config_path}' has been restored from original distro. Modern configuration was placed in '{path_to_backup}'.") + motd.add_finish_ssh_login_message(f"The dovecot configuration '{self.dovecot_config_path}' has been restored from original distro. Modern configuration was placed in '{path_to_backup}'.\n") files.restore_file_from_backup(self.dovecot_config_path) return action.ActionResult() diff --git a/pleskdistup/actions/spamassassin.py b/pleskdistup/actions/spamassassin.py index 9a1fd57..cac5f42 100644 --- a/pleskdistup/actions/spamassassin.py +++ b/pleskdistup/actions/spamassassin.py @@ -59,7 +59,7 @@ def _post_action(self) -> action.ActionResult: # TODO. Following action is not supported on deb-based system. Actually it will be just skipped. # So if you are going to use the action on deb-based, you should be ready there will be no .rpmnew # things or even file here (obviously). - if dist.get_distro().rhel_based(): + if dist.get_distro().rhel_based: if rpm.handle_rpmnew(SPAMASSASIN_CONFIG_PATH): motd.add_finish_ssh_login_message( f"Note that spamassasin configuration '{SPAMASSASIN_CONFIG_PATH}' was changed during conversion. " diff --git a/pleskdistup/common/src/systemd.py b/pleskdistup/common/src/systemd.py index faf50eb..e9428b3 100644 --- a/pleskdistup/common/src/systemd.py +++ b/pleskdistup/common/src/systemd.py @@ -14,13 +14,13 @@ SYSTEMCTL_SERVICES_PATH = "/lib/systemd/system" -def is_service_exists(service: str): +def is_service_exists(service: str) -> bool: res = subprocess.run([SYSTEMCTL_BIN_PATH, 'cat', service], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return res.returncode == 0 -def is_service_active(service: str): - res = subprocess.run([SYSTEMCTL_BIN_PATH, 'is-active', service]) +def is_service_active(service: str) -> bool: + res = subprocess.run([SYSTEMCTL_BIN_PATH, 'is-active', service], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) return res.returncode == 0