From cf5d79c6fd698700c1826ce7ce2a16be7e928a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Thu, 26 Sep 2024 10:29:29 +0200 Subject: [PATCH] roles: make naming_context a @property Otherwise we use the ssh/ldap connection inside the constructor which can cause troubles. --- sssd_test_framework/roles/ad.py | 14 +++++++++----- sssd_test_framework/roles/samba.py | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/sssd_test_framework/roles/ad.py b/sssd_test_framework/roles/ad.py index 4d6a5b9..66e6a12 100644 --- a/sssd_test_framework/roles/ad.py +++ b/sssd_test_framework/roles/ad.py @@ -63,11 +63,6 @@ def __init__(self, *args, **kwargs) -> None: Active Directory domain name. """ - self.naming_context: str = self.host.naming_context - """ - Active Directory naming context. - """ - self.realm: str = self.host.realm """ Kerberos realm. @@ -128,6 +123,15 @@ def test_example_autofs(client: Client, ad: AD, nfs: NFS): } """ + @property + def naming_context(self) -> str: + """ + Active Directory naming context. + + :rtype: str + """ + return self.host.naming_context + def fqn(self, name: str) -> str: """ Return fully qualified name in form name@domain. diff --git a/sssd_test_framework/roles/samba.py b/sssd_test_framework/roles/samba.py index 824f3e9..fc61cdf 100644 --- a/sssd_test_framework/roles/samba.py +++ b/sssd_test_framework/roles/samba.py @@ -59,11 +59,6 @@ def __init__(self, *args, **kwargs) -> None: Samba domain name. """ - self.naming_context: str = self.host.naming_context - """ - Samba naming context. - """ - self.realm: str = self.host.realm """ Kerberos realm. @@ -124,6 +119,15 @@ def test_example_autofs(client: Client, samba: Samba, nfs: NFS): # Set AD schema for automount self.automount.set_schema(self.automount.Schema.AD) + @property + def naming_context(self) -> str: + """ + Samba naming context. + + :rtype: str + """ + return self.host.naming_context + def fqn(self, name: str) -> str: """ Return fully qualified name in form name@domain.