diff options
Diffstat (limited to 'bin/redhat/srtool_redhat.py')
-rwxr-xr-x | bin/redhat/srtool_redhat.py | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/bin/redhat/srtool_redhat.py b/bin/redhat/srtool_redhat.py index 27a568a7..f570965c 100755 --- a/bin/redhat/srtool_redhat.py +++ b/bin/redhat/srtool_redhat.py @@ -31,14 +31,10 @@ import sys import re import json import argparse -import subprocess -from datetime import datetime, date -from urllib.request import urlopen, URLError, Request -from urllib.parse import urlparse - -# Constants +from urllib.request import urlopen, Request +# Setup: srtDbName = 'srt.sqlite' redhat_cache_dir = 'data/cache/redhat' @@ -73,8 +69,6 @@ def get_override(key): # REST API, cache the results # -import collections - summary = {} def extract_json(k,parent,maxdepth): @@ -132,7 +126,7 @@ def fetch_cve(cve_name): msg = e # Cache the error result so that we do not keep hitting that server with open(datasource_file, 'w') as fp: - json.dump({'bugzilla': {'description':msg}}, fp) + json.dump({'bugzilla': {'description':msg}}, fp) print("description=%s" % msg) return @@ -147,7 +141,7 @@ def fetch_cve(cve_name): extract_json(dct,'',10) # for key in summary.keys(): -# print("FOO %s=%s" % (key,summary[key])) +# print("KEY_LIST: %s=%s" % (key,summary[key])) # Translate the content to NIST schema results = {} @@ -199,6 +193,5 @@ def main(argv): print("Command not found") if __name__ == '__main__': - global srtool_basepath srtool_basepath = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))) main(sys.argv[1:]) |