mirror of
https://github.com/usnistgov/macos_security.git
synced 2026-02-03 14:03:24 +00:00
chore: more linting and adjustments
This commit is contained in:
@@ -7,7 +7,7 @@ from typing import Any
|
||||
|
||||
# Additional python modules
|
||||
import pandas as pd
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel
|
||||
|
||||
# Local python modules
|
||||
from ..common_utils import config, create_yaml, open_file
|
||||
|
||||
@@ -203,7 +203,7 @@ def generate_excel(file_out: Path, baseline: Baseline) -> None:
|
||||
for cell in sheet[1]:
|
||||
cell.font = header_font
|
||||
|
||||
for row_idx, row in enumerate(
|
||||
for _, row in enumerate(
|
||||
sheet.iter_rows(
|
||||
min_row=2, max_row=sheet.max_row, min_col=1, max_col=sheet.max_column
|
||||
),
|
||||
|
||||
@@ -5,13 +5,11 @@ import argparse
|
||||
import sys
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
from xml.sax.saxutils import escape
|
||||
from xml.dom import minidom
|
||||
|
||||
|
||||
# Additional python modules
|
||||
from jinja2 import Environment, FileSystemLoader
|
||||
|
||||
# Local python modules
|
||||
from ..classes import Macsecurityrule
|
||||
@@ -144,8 +142,9 @@ def generate_scap(args: argparse.Namespace) -> None:
|
||||
try:
|
||||
if b in rule["odv"]:
|
||||
odv_tag = b
|
||||
except:
|
||||
pass
|
||||
except (TypeError, KeyError) as e:
|
||||
logger.warning(f"Error when looking up ODV for {rule.rule_id}: {e}")
|
||||
|
||||
rule._fill_in_odv(b)
|
||||
|
||||
xccdfProfiles = (
|
||||
@@ -247,10 +246,10 @@ def generate_scap(args: argparse.Namespace) -> None:
|
||||
else:
|
||||
selected_os_benchmark.append(benchmark)
|
||||
|
||||
if rule.odv != None:
|
||||
if rule.odv is not None:
|
||||
if args.baseline == "all_rules":
|
||||
selected_os_benchmark.append("recommended")
|
||||
for k, v in rule.odv.items():
|
||||
for k, _ in rule.odv.items():
|
||||
if k == "hint":
|
||||
continue
|
||||
if k in selected_os_benchmark:
|
||||
|
||||
Reference in New Issue
Block a user