use f-strings in module utils (#10901)

* use f-strings in module utils

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* remove unused imports

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Alexei Znamensky
2025-10-11 22:43:43 +13:00
committed by GitHub
parent 74b6a0294a
commit b85e263466
51 changed files with 270 additions and 382 deletions

View File

@@ -89,7 +89,7 @@ def uldap():
def construct():
try:
secret_file = open('/etc/ldap.secret', 'r')
bind_dn = 'cn=admin,{0}'.format(base_dn())
bind_dn = f'cn=admin,{base_dn()}'
except IOError: # pragma: no cover
secret_file = open('/etc/machine.secret', 'r')
bind_dn = config_registry()["ldap/hostdn"]
@@ -186,7 +186,7 @@ def module_by_name(module_name_):
univention.admin.modules.init(uldap(), position_base_dn(), module)
return module
return _singleton('module/%s' % module_name_, construct)
return _singleton(f'module/{module_name_}', construct)
def get_umc_admin_objects():