Skip to content

Commit 023a764

Browse files
author
Shane Wright
committed
nuke some TODOs and remove unused function
1 parent 9ecb60f commit 023a764

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

examples/client/parse_spdx.py

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,9 @@ def spdx_validate(document):
125125
validation_messages = validate_full_spdx_document(document)
126126
print(f"SPDX validation took {time.process_time() - start} seconds")
127127

128-
# TODO is there a way to distinguish between something fatal and something
129-
# BD can deal with?
130128
for validation_message in validation_messages:
131-
# Just printing these messages intead of exiting. Later when we try to import
132-
# the file to BD, let's plan to exit if it fails. Seeing lots of errors in the
133-
# sample data.
129+
# Just printing these messages intead of exiting.
130+
# Later when the file is imported, BD errors will be fatal.
134131
logging.warning(validation_message.validation_message)
135132

136133
# Returns MIME type to provide to scan API
@@ -272,29 +269,6 @@ def poll_for_sbom_scan(sbom_name, projver):
272269
# If we got this far, it's a fatal error.
273270
sys.exit(1)
274271

275-
# Poll for BOM completion
276-
# TODO currently unused, may delete
277-
# Input: Name of SBOM document (not the filename, the name defined inside the json body)
278-
# Returns on success. Errors will result in fatal exit.
279-
def poll_for_bom_complete(proj_version_url):
280-
max_retries = 30
281-
sleep_time = 10
282-
283-
while (max_retries):
284-
max_retries -= 1
285-
json_data = bd.get_json(proj_version_url + "/bom-status")
286-
if json_data['status'] == "UP_TO_DATE":
287-
return
288-
elif json_data['status'] == "FAILURE":
289-
logging.error(f"BOM Scan Failed")
290-
sys.exit(1)
291-
elif json_data['status'] == "NOT_INCLUDED":
292-
logging.error(f"BOM scan had no matches")
293-
sys.exit(1)
294-
else:
295-
print(f"Waiting for BOM scan success, currently: {json_data['status']}")
296-
time.sleep(sleep_time)
297-
298272
# Upload provided SBOM file to Black Duck
299273
# Inputs:
300274
# filename - Name of file to upload

0 commit comments

Comments
 (0)