1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-15 00:11:29 +00:00

[PR #11341/5b5f7e9e backport][stable-12] batch 1 - update Python idiom to 3.7 using pyupgrade (#11349)

batch 1 - update Python idiom to 3.7 using pyupgrade (#11341)

* batch 1 - update Python idiom to 3.7 using pyupgrade

* add changelog frag

* add changelog frag

(cherry picked from commit 5b5f7e9e64)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2025-12-30 16:47:11 +01:00 committed by GitHub
parent 41f815be57
commit 2d07481e64
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 48 additions and 29 deletions

View file

@ -88,10 +88,10 @@ def uldap():
def construct():
try:
secret_file = open("/etc/ldap.secret", "r")
secret_file = open("/etc/ldap.secret")
bind_dn = f"cn=admin,{base_dn()}"
except IOError: # pragma: no cover
secret_file = open("/etc/machine.secret", "r")
except OSError: # pragma: no cover
secret_file = open("/etc/machine.secret")
bind_dn = config_registry()["ldap/hostdn"]
pwd_line = secret_file.readline()
pwd = re.sub("\n", "", pwd_line)