Spaces:
Running
Running
Download server/faults/__init__.py from brand0nwalls/NetOps: direct link, hf CLI and curl.
- Browser
- Download file 1.34 kB
-
https://huggingface.co/spaces/brand0nwalls/NetOps/resolve/main/server/faults/__init__.py
- Command line
-
hf download hf://spaces/brand0nwalls/NetOps/server/faults/__init__.py
-
curl -L -o __init__.py https://huggingface.co/spaces/brand0nwalls/NetOps/resolve/main/server/faults/__init__.py
1.34 kB
| """Fault registry — merges all fault modules into a single FAULT_REGISTRY dict. | |
| Each module exports FAULTS = {"name": {"fn": callable, "difficulty": str, "needs": str}}. | |
| """ | |
| from server.faults.physical import FAULTS as _physical | |
| from server.faults.datalink import FAULTS as _datalink | |
| from server.faults.qos import FAULTS as _qos | |
| from server.faults.ospf import FAULTS as _ospf | |
| from server.faults.bgp_control import FAULTS as _bgp_control | |
| from server.faults.bgp_policy import FAULTS as _bgp_policy | |
| from server.faults.firewall import FAULTS as _firewall | |
| from server.faults.routing_logic import FAULTS as _routing_logic | |
| from server.faults.system import FAULTS as _system | |
| from server.faults.compound import FAULTS as _compound | |
| from server.faults.novel import FAULTS as _novel | |
| FAULT_REGISTRY: dict[str, dict] = {} | |
| for _module_faults in [ | |
| _physical, _datalink, _qos, _ospf, _bgp_control, _bgp_policy, | |
| _firewall, _routing_logic, _system, _compound, _novel, | |
| ]: | |
| FAULT_REGISTRY.update(_module_faults) | |
| EASY = [k for k, v in FAULT_REGISTRY.items() if v["difficulty"] == "easy"] | |
| MEDIUM = EASY + [k for k, v in FAULT_REGISTRY.items() if v["difficulty"] == "medium"] | |
| HARD = MEDIUM + [k for k, v in FAULT_REGISTRY.items() if v["difficulty"] == "hard"] | |
| EXPERT = HARD + [k for k, v in FAULT_REGISTRY.items() if v["difficulty"] == "expert"] | |