Skip to content

Commit 4392280

Browse files
author
Shane Wright
committed
just print warnings from validation messages
1 parent d9e788c commit 4392280

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

examples/client/parse_spdx.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,12 @@ def find_comp_in_bom(bd, compname, compver, projver):
147147
start = time.process_time()
148148
validation_messages = validate_full_spdx_document(document)
149149
print(f"SPDX validation took {time.process_time() - start} seconds")
150-
fatal = False
150+
151+
# TODO is there a way to distinguish between something fatal and something
152+
# BD can deal with?
153+
# I guess we can just print all the msgs and then also exit when the import fails..
151154
for validation_message in validation_messages:
152-
if re.match(r'.*WARNING.*', validation_message.validation_message):
153-
logging.warning(validation_message.validation_message)
154-
if re.match(r'.*ERROR.*', validation_message.validation_message):
155-
logging.error(validation_message.validation_message)
156-
fatal = True
157-
158-
if fatal:
159-
print("we are dead")
160-
quit()
155+
logging.warning(validation_message.validation_message)
161156

162157
with open(args.token_file, 'r') as tf:
163158
access_token = tf.readline().strip()

0 commit comments

Comments
 (0)