INNER CODE UNIT · Python
validate_loobin
infosecB/LOOBins · src/pyloobins/util.py:55
def validate_loobin(yml_path: str) -> bool:
"""Validates LOOBin YAML file"""
with open(yml_path, "r", encoding="utf-8") as stream:
try:
yml_content = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(f"Error parsing {yml_path}: {exc}")
return False
try:
LOOBin(**yml_content)
return True
except Exception as exc:
print(f"Validation error in {yml_path}: {exc}")
return False
def make_template(name: str = "") -> LOOBin:
"""Creates a template LOOBin object"""