aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPetr Svenda2020-02-27 10:43:42 +0100
committerPetr Svenda2020-02-27 10:43:42 +0100
commit25f2c78a0dc322f878f0802a9d08e544db3b4889 (patch)
tree73ee6b441b8cd5bf5277534a955bf44f5ee9c72c
parent323576205766ccd0332d62c1b30854880deee0d9 (diff)
downloadsec-certs-25f2c78a0dc322f878f0802a9d08e544db3b4889.tar.gz
sec-certs-25f2c78a0dc322f878f0802a9d08e544db3b4889.tar.zst
sec-certs-25f2c78a0dc322f878f0802a9d08e544db3b4889.zip
added conditional write of output to json file
-rw-r--r--src/extract_certificates.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/extract_certificates.py b/src/extract_certificates.py
index bbc05ce8..27bd4da3 100644
--- a/src/extract_certificates.py
+++ b/src/extract_certificates.py
@@ -1518,8 +1518,9 @@ def extract_certificates_html(base_dir, write_output_file = True):
for item in items_found_all_active.keys():
items_found_all_active[item]['html_scan']['cert_status'] = 'active'
- with open("certificate_data_html_active.json", "w", errors=FILE_ERRORS_STRATEGY) as write_file:
- write_file.write(json.dumps(items_found_all_active, indent=4, sort_keys=True))
+ if write_output_file:
+ with open("certificate_data_html_active.json", "w", errors=FILE_ERRORS_STRATEGY) as write_file:
+ write_file.write(json.dumps(items_found_all_active, indent=4, sort_keys=True))
generate_download_script('download_active_certs.bat', 'certs', 'targets', CC_WEB_URL, download_files_certs)
generate_download_script('download_active_updates.bat', 'certs', 'targets', CC_WEB_URL, download_files_updates)
@@ -1529,8 +1530,9 @@ def extract_certificates_html(base_dir, write_output_file = True):
for item in items_found_all_archived.keys():
items_found_all_archived[item]['html_scan']['cert_status'] = 'archived'
- with open("certificate_data_html_archived.json", "w", errors=FILE_ERRORS_STRATEGY) as write_file:
- write_file.write(json.dumps(items_found_all_archived, indent=4, sort_keys=True))
+ if write_output_file:
+ with open("certificate_data_html_archived.json", "w", errors=FILE_ERRORS_STRATEGY) as write_file:
+ write_file.write(json.dumps(items_found_all_archived, indent=4, sort_keys=True))
generate_download_script('download_archived_certs.bat', 'certs', 'targets', CC_WEB_URL, download_files_certs)
generate_download_script('download_archived_updates.bat', 'certs', 'targets', CC_WEB_URL, download_files_updates)