From 974d1b66e3008a1cbc3364efec3b053f84d55c11 Mon Sep 17 00:00:00 2001 From: Dan Lavu Date: Mon, 23 Sep 2024 12:14:49 -0400 Subject: [PATCH] sssdutils: adding with-mkhomedir common configuration * fixed some minor docstrings typos --- sssd_test_framework/utils/sssd.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/sssd_test_framework/utils/sssd.py b/sssd_test_framework/utils/sssd.py index 9646304..fa65c53 100644 --- a/sssd_test_framework/utils/sssd.py +++ b/sssd_test_framework/utils/sssd.py @@ -125,6 +125,8 @@ def async_start( :param service: Service to start, defaults to 'sssd' :type service: str, optional + :param service_user: User used to start the service, defaults to 'sssd' + :type service_user: str, optional :param apply_config: Apply current configuration, defaults to True :type apply_config: bool, optional :param check_config: Check configuration for typos, defaults to True @@ -160,6 +162,8 @@ def start( :param service: Service to start, defaults to 'sssd' :type service: str, optional + :param service_user: User used to start the service, defaults to 'sssd' + :type service_user: str, optional :param raise_on_error: Raise exception on error, defaults to True :type raise_on_error: bool, optional :param apply_config: Apply current configuration, defaults to True @@ -448,7 +452,7 @@ def genconf(self, section: str | None = None) -> ProcessResult: Exec ``sssd --genconf`` or ``sssd --genconf-section=section`` if ``section`` is not ``None``. :param section: Section that will be refreshed. Defaults to ``None``. - :type path: str | None, optional + :type section: str | None, optional :return: Result of the ran command. :rtype: ProcessResult """ @@ -690,7 +694,7 @@ def __config_dumps(cfg: configparser.ConfigParser) -> str: ss.seek(0) return ss.read() - def __set_debug_level(self, debug_level: str | None = None) -> configparser.ConfigParser: + def __set_debug_level(self, debug_level: str | None = None, ) -> configparser.ConfigParser: """Set debug level in all sections.""" cfg = configparser.ConfigParser(interpolation=None) cfg.read_dict(self.config) @@ -861,6 +865,14 @@ def gssapi(self) -> None: self.sssd.domain["pam_gssapi_services"] = "sudo, sudo-i" self.sssd.domain["pam_gssapi_check_upn"] = "False" + def mkhomedir(self) -> None: + """ + Configure SSSD with mkhomedir and oddjobd. + """ + + self.sssd.authselect.select("sssd", ["with-mkhomedir"]) + self.sssd.svc.start("oddjobd.service") + def autofs(self) -> None: """ Configure SSSD with autofs.