Skip to content

Commit

Permalink
controller: Parse fault_address_exclude
Browse files Browse the repository at this point in the history
  • Loading branch information
aewag committed Apr 27, 2023
1 parent 919f1d2 commit 25f32d6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,16 @@ def build_fault_list(conf_list, combined_faults, ret_faults):
wildcard_fault = True
elif type(faultdev["fault_address"]) == list and "*" in faultdev["fault_address"]:
wildcard_fault = True

ftype = detect_type(faultdev["fault_type"])
fmodel = detect_model(faultdev["fault_model"])

faddress_exclude = (
[build_ranges(lst) for lst in faultdev["fault_address_exclude"]]
if "fault_address_exclude" in faultdev
else []
)

for faddress in build_ranges(faultdev["fault_address"], wildcard_fault):
for flifespan in build_ranges(faultdev["fault_lifespan"]):
for fmask in build_ranges(faultdev["fault_mask"]):
Expand All @@ -215,7 +223,7 @@ def build_fault_list(conf_list, combined_faults, ret_faults):
int_faults.append(
Fault(
faddress,
[],
faddress_exclude,
ftype,
fmodel,
flifespan,
Expand Down

0 comments on commit 25f32d6

Please sign in to comment.