Fixed FURB113 (repeated-append)
This commit is contained in:
parent
e8d1c037cb
commit
541f31b1ba
|
@ -674,8 +674,7 @@ def hash_dnssec_keys(domain, env):
|
||||||
keydata = []
|
keydata = []
|
||||||
for keytype, keyfn in sorted(find_dnssec_signing_keys(domain, env)):
|
for keytype, keyfn in sorted(find_dnssec_signing_keys(domain, env)):
|
||||||
oldkeyfn = os.path.join(env['STORAGE_ROOT'], 'dns/dnssec', keyfn + ".private")
|
oldkeyfn = os.path.join(env['STORAGE_ROOT'], 'dns/dnssec', keyfn + ".private")
|
||||||
keydata.append(keytype)
|
keydata.extend((keytype, keyfn))
|
||||||
keydata.append(keyfn)
|
|
||||||
with open(oldkeyfn) as fr:
|
with open(oldkeyfn) as fr:
|
||||||
keydata.append( fr.read() )
|
keydata.append( fr.read() )
|
||||||
keydata = "".join(keydata).encode("utf8")
|
keydata = "".join(keydata).encode("utf8")
|
||||||
|
|
|
@ -302,8 +302,7 @@ def scan_mail_log(env):
|
||||||
for date, sender, message in user_data["blocked"]:
|
for date, sender, message in user_data["blocked"]:
|
||||||
if len(sender) > 64:
|
if len(sender) > 64:
|
||||||
sender = sender[:32] + "…" + sender[-32:]
|
sender = sender[:32] + "…" + sender[-32:]
|
||||||
user_rejects.append("{} - {} ".format(date, sender))
|
user_rejects.extend(('{} - {} '.format(date, sender), ' %s' % message))
|
||||||
user_rejects.append(" %s" % message)
|
|
||||||
rejects.append(user_rejects)
|
rejects.append(user_rejects)
|
||||||
|
|
||||||
print_user_table(
|
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:
|
if sub_data is not None:
|
||||||
for l, d in sub_data:
|
for l, d in sub_data:
|
||||||
if d[row]:
|
if d[row]:
|
||||||
lines.append("┬")
|
lines.extend(('┬', '│ %s' % l, '├─%s─' % (len(l) * '─'), '│'))
|
||||||
lines.append("│ %s" % l)
|
|
||||||
lines.append("├─%s─" % (len(l) * "─"))
|
|
||||||
lines.append("│")
|
|
||||||
max_len = 0
|
max_len = 0
|
||||||
for v in list(d[row]):
|
for v in list(d[row]):
|
||||||
lines.append("│ %s" % v)
|
lines.append("│ %s" % v)
|
||||||
|
|
Loading…
Reference in New Issue