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
This commit is contained in:
Alexei Znamensky
2025-12-31 04:15:24 +13:00
committed by GitHub
parent a0d3bac88c
commit 5b5f7e9e64
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)