diff options
author | 2009-12-03 19:28:03 +0100 | |
---|---|---|
committer | 2009-12-03 19:28:03 +0100 | |
commit | 971c08ef3b66f326817bf3dd08df99f72a685ec3 (patch) | |
tree | 8e04e4318a818cca1716e306a7723eca5784c19b | |
parent | Use gnu_getopt (diff) | |
download | kernel-check-971c08ef3b66f326817bf3dd08df99f72a685ec3.tar.gz kernel-check-971c08ef3b66f326817bf3dd08df99f72a685ec3.tar.bz2 kernel-check-971c08ef3b66f326817bf3dd08df99f72a685ec3.zip |
Change CLI output
-rwxr-xr-x | pym/kernelcheck/kernelcheck.py | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/pym/kernelcheck/kernelcheck.py b/pym/kernelcheck/kernelcheck.py index eb039b9..a9d6e9f 100755 --- a/pym/kernelcheck/kernelcheck.py +++ b/pym/kernelcheck/kernelcheck.py @@ -132,7 +132,7 @@ def print_items(category, header): if portage.output.get_term_size()[1] < screenwidth: screenwidth = portage.output.get_term_size()[1] - info(bold('%s%s' % (header, ':'))) + info(bold('%s:' % header)) for item in category.keys(): for i, string in enumerate(textwrap.wrap('%s' % category[item], (screenwidth - 23))): @@ -154,16 +154,9 @@ def print_summary(vullist): if item.cves: for cve in item.cves: - severity = 'BAD' - if cve.severity == 'Low': - severity = 'GOOD' - elif cve.severity == 'Medium': - severity = 'WARN' - cve_text = str() - if 'AV:L' in cve.vector: - cve_text += colorize('WARN', 'local') + cve_text += colorize('BAD', 'local') if 'AV:A' in cve.vector or 'AV:N' in cve.vector: cve_text += colorize('BAD', 'network') @@ -182,9 +175,9 @@ def print_summary(vullist): if 'A:P' in cve.vector or 'A:C' in cve.vector: cve_text += '%s%s' % (' ', blue('-availability')) - print '[%s %26s] %s CVSS="%s %s"' % (darkgreen('bugid'), + print '[%s %26s] %s %s TYPE="%s"' % (darkgreen('bugid'), colorize('GOOD', item.bugid), darkgreen(cve.cve), - colorize(severity, cve.score), cve_text) + blue('[%s]' % cve.score), cve_text) print '' @@ -211,7 +204,7 @@ def print_bug(bugid): } print '' - print_items(buginformation, '%s%s' % ('Bugid ', bugid)) + print_items(buginformation, 'Bugid %s' % bugid) for cve in vul.cves: print_cve(cve.cve) |