mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge pull request #1378 from YunoHost/ci-format-dev
[CI] Format code with Black
This commit is contained in:
commit
2d9bfdce2a
2 changed files with 11 additions and 4 deletions
|
@ -210,7 +210,10 @@ class MailDiagnoser(Diagnoser):
|
||||||
|
|
||||||
# Do the DNS Query
|
# Do the DNS Query
|
||||||
status, answers = dig(query, "A")
|
status, answers = dig(query, "A")
|
||||||
if status != "ok" or (answers and set(answers) <= set(blacklist["non_blacklisted_return_code"])):
|
if status != "ok" or (
|
||||||
|
answers
|
||||||
|
and set(answers) <= set(blacklist["non_blacklisted_return_code"])
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Try to get the reason
|
# Try to get the reason
|
||||||
|
|
|
@ -749,8 +749,12 @@ class OperationLogger(object):
|
||||||
# 72971 [37m[1mDEBUG [m29739 + ynh_exit_properly
|
# 72971 [37m[1mDEBUG [m29739 + ynh_exit_properly
|
||||||
# which are lines from backup-before-upgrade or restore-after-failed-upgrade ...
|
# which are lines from backup-before-upgrade or restore-after-failed-upgrade ...
|
||||||
filters = [re.compile(f_) for f_ in BORING_LOG_LINES]
|
filters = [re.compile(f_) for f_ in BORING_LOG_LINES]
|
||||||
filters.append(re.compile(r'\d+ \+ '))
|
filters.append(re.compile(r"\d+ \+ "))
|
||||||
lines = [line for line in lines if not any(filter_.search(line) for filter_ in filters)]
|
lines = [
|
||||||
|
line
|
||||||
|
for line in lines
|
||||||
|
if not any(filter_.search(line) for filter_ in filters)
|
||||||
|
]
|
||||||
|
|
||||||
lines_to_display = []
|
lines_to_display = []
|
||||||
|
|
||||||
|
@ -758,7 +762,7 @@ class OperationLogger(object):
|
||||||
rev_lines = list(reversed(lines))
|
rev_lines = list(reversed(lines))
|
||||||
for i, line in enumerate(rev_lines):
|
for i, line in enumerate(rev_lines):
|
||||||
if line.endswith("+ ynh_exit_properly"):
|
if line.endswith("+ ynh_exit_properly"):
|
||||||
lines_to_display = reversed(rev_lines[i:i + 20])
|
lines_to_display = reversed(rev_lines[i : i + 20])
|
||||||
break
|
break
|
||||||
|
|
||||||
# If didnt find anything, just get the last 20 lines
|
# If didnt find anything, just get the last 20 lines
|
||||||
|
|
Loading…
Add table
Reference in a new issue