A follow-up to #429 that simplifies the log format and includes the recog XML filename in the output. Other minor changes include: moving the main method to the bottom fo the file, small PEP 8 correction (two blank lines between top-level function), corrected method comment.
Motivation and Context
Make the output similar to our other tests.
How Has This Been Tested?
CLI
Current log output
$ python3 update_cpes.py xml/http_servers.xml official-cpe-dictionary_v2.3.xml
CRITICAL:root:Expecting exactly 3 arguments; recog XML file, CPE 2.3 XML dictionary, JSON remapping, got 2
$ python3 update_cpes.py xml/http_servers.xml official-cpe-dictionary_v2.3.xml cpe-remap.yaml
ERROR:root:Product squeezebox from vendor logitech invalid for CPE a and no mapping.
ERROR:root:Product bashttpd from vendor avleen_vig invalid for CPE a and no mapping.
ERROR:root:Product envoy from vendor istio invalid for CPE a and no mapping.
...
Updated log output
$ python3 update_cpes.py xml/http_servers.xml official-cpe-dictionary_v2.3.xml
CRITICAL: Expecting exactly 3 arguments; recog XML file, CPE 2.3 XML dictionary, JSON remapping, got 2
$ python3 update_cpes.py xml/http_servers.xml official-cpe-dictionary_v2.3.xml cpe-remap.yaml
xml/http_servers.xml: ERROR: Product squeezebox from vendor logitech invalid for CPE a and no mapping.
xml/http_servers.xml: ERROR: Product bashttpd from vendor avleen_vig invalid for CPE a and no mapping.
xml/http_servers.xml: ERROR: Product envoy from vendor istio invalid for CPE a and no mapping.
...
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
[x] I have updated the documentation accordingly (or changes are not required).
[x] I have added tests to cover my changes (or new tests are not required).
Description
A follow-up to #429 that simplifies the log format and includes the recog XML filename in the output. Other minor changes include: moving the
main
method to the bottom fo the file, small PEP 8 correction (two blank lines between top-level function), corrected method comment.Motivation and Context
Make the output similar to our other tests.
How Has This Been Tested?
Current log output
Updated log output
Types of changes
Checklist: