From d1a36b896be7b29a0cee8581f58321f78377676e Mon Sep 17 00:00:00 2001 From: Alvaro Figueroa Date: Mon, 5 Dec 2022 14:17:39 -0600 Subject: [PATCH] Adds Suse detection, which fixes sshd restart problem when Password Change in portal (#1627) --- Utils/distroutils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Utils/distroutils.py b/Utils/distroutils.py index cdc4acea0..b6b611eb6 100644 --- a/Utils/distroutils.py +++ b/Utils/distroutils.py @@ -36,6 +36,9 @@ def get_my_distro(config): if re.search("freebsd", os_name, re.IGNORECASE): # FreeBSD return FreeBSDDistro(config) + if re.search("sles", os_name, re.IGNORECASE): + # SuSE + return SuSEDistro(config) return GenericDistro(config) @@ -512,3 +515,10 @@ def create_account(self, user, password, expiration, thumbprint): def delete_account(self, user): ext_utils.run(['/sbin/usermod', user, '-G', '']) + + +class SuSEDistro(GenericDistro): + def __init__(self, config): + super(SuSEDistro, self).__init__(config) + self.ssh_service_name = 'sshd' + self.distro_name = "SuSE"