Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: Add check in rulecat.py if sid is None as otherwise script aborts #94

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions idstools/scripts/rulecat.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import shutil
import glob
import io
from pprint import pprint

if sys.argv[0] == __file__:
sys.path.insert(
Expand Down Expand Up @@ -549,6 +550,10 @@ def build_rule_map(rules):
rulemap = {}

for rule in rules:
if rule["sid"] is None:
print("error in parsing rule, id is missing")
pprint(vars(rule))
sys.exit(1)
if rule.id not in rulemap:
rulemap[rule.id] = rule
else:
Expand Down