Skip to content

Commit

Permalink
selftest: require named parameters for callers of connect_samdb() and…
Browse files Browse the repository at this point in the history
… connect_samdb_ex()

Signed-off-by: Rob van der Linde <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
Reviewed-by: Douglas Bagnall <[email protected]>
  • Loading branch information
robvdl authored and douglasbagnall committed Dec 21, 2023
1 parent 5e82372 commit ba29bb5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/samba/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def random_password(self, count=32):
return password


def connect_samdb(samdb_url, lp=None, session_info=None, credentials=None,
def connect_samdb(samdb_url, *, lp=None, session_info=None, credentials=None,
flags=0, ldb_options=None, ldap_only=False, global_schema=True):
"""Create SamDB instance and connects to samdb_url database.
Expand Down Expand Up @@ -625,7 +625,7 @@ def connect_samdb(samdb_url, lp=None, session_info=None, credentials=None,
global_schema=global_schema)


def connect_samdb_ex(samdb_url, lp=None, session_info=None, credentials=None,
def connect_samdb_ex(samdb_url, *, lp=None, session_info=None, credentials=None,
flags=0, ldb_options=None, ldap_only=False):
"""Connects to samdb_url database
Expand All @@ -637,8 +637,9 @@ def connect_samdb_ex(samdb_url, lp=None, session_info=None, credentials=None,
:param ldap_only: If set, only remote LDAP connection will be created.
:return: (sam_db_connection, rootDse_record) tuple
"""
sam_db = connect_samdb(samdb_url, lp, session_info, credentials,
flags, ldb_options, ldap_only)
sam_db = connect_samdb(samdb_url, lp=lp, session_info=session_info,
credentials=credentials, flags=flags,
ldb_options=ldb_options, ldap_only=ldap_only)
# fetch RootDse
res = sam_db.search(base="", expression="", scope=ldb.SCOPE_BASE,
attrs=["*"])
Expand Down

0 comments on commit ba29bb5

Please sign in to comment.