Skip to content

Commit

Permalink
roles: make naming_context a @Property
Browse files Browse the repository at this point in the history
Otherwise we use the ssh/ldap connection inside the constructor
which can cause troubles.
  • Loading branch information
pbrezina committed Sep 30, 2024
1 parent e946304 commit cf5d79c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
14 changes: 9 additions & 5 deletions sssd_test_framework/roles/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
14 changes: 9 additions & 5 deletions sssd_test_framework/roles/samba.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit cf5d79c

Please sign in to comment.