mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
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:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user