Fixed FURB113 (repeated-append)

This commit is contained in:
Teal Dulcet 2023-12-22 07:20:10 -08:00 committed by Joshua Tauberer
parent e8d1c037cb
commit 541f31b1ba
2 changed files with 3 additions and 8 deletions

View File

@ -674,8 +674,7 @@ def hash_dnssec_keys(domain, env):
keydata = []
for keytype, keyfn in sorted(find_dnssec_signing_keys(domain, env)):
oldkeyfn = os.path.join(env['STORAGE_ROOT'], 'dns/dnssec', keyfn + ".private")
keydata.append(keytype)
keydata.append(keyfn)
keydata.extend((keytype, keyfn))
with open(oldkeyfn) as fr:
keydata.append( fr.read() )
keydata = "".join(keydata).encode("utf8")

View File

@ -302,8 +302,7 @@ def scan_mail_log(env):
for date, sender, message in user_data["blocked"]:
if len(sender) > 64:
sender = sender[:32] + "" + sender[-32:]
user_rejects.append("{} - {} ".format(date, sender))
user_rejects.append(" %s" % message)
user_rejects.extend(('{} - {} '.format(date, sender), ' %s' % message))
rejects.append(user_rejects)
print_user_table(
@ -710,10 +709,7 @@ def print_user_table(users, data=None, sub_data=None, activity=None, latest=None
if sub_data is not None:
for l, d in sub_data:
if d[row]:
lines.append("")
lines.append("%s" % l)
lines.append("├─%s" % (len(l) * ""))
lines.append("")
lines.extend(('', '%s' % l, '├─%s' % (len(l) * ''), ''))
max_len = 0
for v in list(d[row]):
lines.append("%s" % v)