Skip to content

Commit

Permalink
nit: logging
Browse files Browse the repository at this point in the history
  • Loading branch information
northdpole committed Jun 26, 2024
1 parent 695f026 commit ff1f904
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ParseResult(object):
calculate_gap_analysis: bool = True
calculate_embeddings: bool = True


class ParserInterface(object):
# The name of the resource being parsed
name: str
Expand Down
8 changes: 8 additions & 0 deletions application/utils/gap_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,25 @@ def preload(target_url: str):
if res1.json().get("result"):
forward = True
if f"{sa}->{sb}" in waiting:
print(f"gap analysis {sa}->{sb} returned")
waiting.remove(f"{sa}->{sb}")
else:
print(f"{sa}->{sb} returned 200 but has no 'result' key")
res2 = requests.get(
f"{target_url}/rest/v1/map_analysis?standard={sb}&standard={sa}"
)
if res2.status_code != 200:
print(f"{sb}->{sa} returned {res1.status_code}")
elif res2.json():
print(f"{sb}->{sa} success")
if res2.json().get("result"):
backward = True
if f"{sb}->{sa}" in waiting:
print(f"gap analysis {sb}->{sa} returned")
waiting.remove(f"{sb}->{sa}")
else:
print(f"{sb}->{sa} returned 200 but has no 'result' key")

if forward and backward:
print(
f"removing standard {sb} from the waiting list as it has returned "
Expand Down
2 changes: 1 addition & 1 deletion scripts/import-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ if [[ -z $CRE_SKIP_IMPORT_PROJECTS ]]; then
python cre.py --owasp_secure_headers_in
echo "Importing PCI DSS 4"
python cre.py --pci_dss_4_in
echo "Importing Juicshop"
echo "Importing Juiceshop"
python cre.py --juiceshop_in
echo "Importing DSOMM"
python cre.py --dsomm_in
Expand Down

0 comments on commit ff1f904

Please sign in to comment.