Commit 28db1e4b authored by Chris Lamb's avatar Chris Lamb 💬

bin/lts-cve-triage.py: Fix flake8 (3.7.8-3) warnings

parent 76f08cc1
......@@ -22,17 +22,18 @@ import collections
from tracker_data import TrackerData, RELEASES
from unsupported_packages import UnsupportedPackages, LimitedSupportPackages
def colored(x, *args, **kwargs):
return x
colored_on = False
try:
if sys.stdout.isatty():
from termcolor import colored
from termcolor import colored # noqa
colored_on = True
except ImportError:
print("Note: you can install python3-termcolor for colored output",
file=sys.stderr)
colored_on = False
def colored(x, *args, **kwargs):
return x
TRACKER_URL = 'https://security-tracker.debian.org/tracker/'
......@@ -42,28 +43,27 @@ LIST_NAMES = (
('triage_limited_support',
'Issues on packages with limited support (review support rules)'),
('triage_already_in_dsa_needed',
('Issues to triage for {lts} that are already in dsa-needed'
).format(**RELEASES)),
('Issues to triage for {lts} that are already in dsa-needed')
.format(**RELEASES)),
('triage_likely_nodsa',
('Issues to triage for {lts} that are no-dsa in {next_lts}'
).format(**RELEASES)),
('Issues to triage for {lts} that are no-dsa in {next_lts}')
.format(**RELEASES)),
('triage_possible_easy_fixes',
('Issues not yet triaged for {lts}, but already fixed in {next_lts}'
).format(**RELEASES)),
('Issues not yet triaged for {lts}, but already fixed in {next_lts}')
.format(**RELEASES)),
('triage_other_not_triaged_in_next_lts',
('Other issues to triage for {lts} (not yet triaged for {next_lts})'
).format(**RELEASES)),
('Other issues to triage for {lts} (not yet triaged for {next_lts})')
.format(**RELEASES)),
('triage_other',
'Other issues to triage (no special status)'),
('unexpected_nodsa',
('Issues tagged no-dsa in {lts} that are open in {next_lts}'
).format(**RELEASES)),
('Issues tagged no-dsa in {lts} that are open in {next_lts}')
.format(**RELEASES)),
('possible_easy_fixes',
('Issues from dla-needed.txt that are already fixed in {next_lts}'
).format(**RELEASES)),
('Issues from dla-needed.txt that are already fixed in {next_lts}')
.format(**RELEASES)),
('undetermined',
('Undetermined issues in {lts}'
).format(**RELEASES)),
('Undetermined issues in {lts}').format(**RELEASES)),
)
lists = collections.defaultdict(lambda: collections.defaultdict(lambda: []))
......@@ -81,7 +81,8 @@ parser.add_argument('--exclude', nargs='+', choices=[x[0] for x in LIST_NAMES],
args = parser.parse_args()
tracker = TrackerData(update_cache=not args.skip_cache_update)
unsupported = UnsupportedPackages(debian_version=8, update_cache=not args.skip_cache_update)
unsupported = UnsupportedPackages(debian_version=8,
update_cache=not args.skip_cache_update)
limited = LimitedSupportPackages(update_cache=not args.skip_cache_update)
......@@ -161,6 +162,12 @@ for key, desc in LIST_NAMES:
))
for x in sorted(lists[key][pkg], key=lambda x: x.name):
url = '{}{}'.format(TRACKER_URL, x.name)
print(' - {:<16s} {} {}'.format(x.name, colored(url, 'blue'), (key == 'unexpected_nodsa' and x.data['releases'][RELEASES['lts']]['nodsa_reason'] or '')))
print(' - {:<16s} {} {}'.format(
x.name,
colored(url, 'blue'),
(key == 'unexpected_nodsa' and
x.data['releases'][RELEASES['lts']]['nodsa_reason']
or '')),
)
print('')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment