Skip to content

Commit

Permalink
Ensure that if validate passes, we capture the
Browse files Browse the repository at this point in the history
system exit raised so we can continue on to test
or other code.  A successful validate call raises
an exit code of 0 that we capture.  Also, provide
some additional info around an errorneous
appinspect error when run with Python3.11+.
  • Loading branch information
pyth0n1c committed Jul 7, 2023
1 parent 0bab8ea commit eb8b3d0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions contentctl/output/conf_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import glob
import shutil
import sys
import tarfile
from typing import Union
from pathlib import Path
Expand Down Expand Up @@ -178,18 +179,17 @@ def inspectApp(self)-> None:
excluded_tags = []

excluded_tags_string = ','.join(excluded_tags)
validate([str(name_without_version)], PRECERT_MODE, included_tags_string, excluded_tags_string)
'''
validate(name_without_version,
PRECERT_MODE,
included_tags,
[],
"output_appinspect",
JSON_DATA_FORMAT,
"dist",
ERROR_LOG_LEVEL,
"dist/appinspect_output.log",
100,
True)
'''

try:
validate([str(name_without_version)], PRECERT_MODE, included_tags_string, excluded_tags_string)
except SystemExit as e:
if e.code == 0:
print("AppInspect passed!")
else:
if sys.version.startswith('3.11') or sys.version.startswith('3.12'):
raise Exception("At this time, AppInspect may fail on valid apps under Python>=3.11 with "
"the error 'global flags not at the start of the expression at position 1'. "
"If you encounter this error, please run AppInspect on a version of Python "
"<3.11. This issue is currently tracked. Please review the appinspect "
"report output above for errors.")
else:
raise Exception("AppInspect Failure - Please review the appinspect report output above for errors.")

0 comments on commit eb8b3d0

Please sign in to comment.