fix: 验收修正

This commit is contained in:
zxr
2026-09-21 10:46:34 +08:00
parent b0ffde3100
commit 972adb3d38
12 changed files with 506 additions and 168 deletions

View File

@@ -238,14 +238,14 @@ class Runner:
"recovery_message": "recover",
"enabled": True,
}
suppression_body = {
"name": f"{suffix}-suppress",
"enabled": True,
"source_ip_cidr": "127.0.0.1/32",
"oid_prefix": "1.3.6.1.4.1.8072",
"interface_hint": "no-match",
"time_windows_json": "[]",
}
suppression_body = {
"name": f"{suffix}-suppress",
"enabled": True,
"source_ip_cidr": "127.0.0.1/32",
"oid_prefixes": ["1.3.6.1.4.1.8072"],
"interface_hint": "no-match",
"time_windows_json": "",
}
created_ids: List[Tuple[str, int]] = []
try:
s1, p1 = http_json("POST", f"{self.cfg.base_url}/syslog-rules", token=self.cfg.token, body=syslog_body)
@@ -345,7 +345,7 @@ class Runner:
for row in payload_obj(p0).get("items", []):
if not row.get("enabled", False):
continue
if str(row.get("source_ip_cidr", "")).strip() == "" and str(row.get("oid_prefix", "")).strip() == "" and str(row.get("interface_hint", "")).strip() == "" and str(row.get("time_windows_json", "")).strip() == "":
if str(row.get("source_ip_cidr", "")).strip() == "" and not row.get("oid_prefixes", []) and str(row.get("interface_hint", "")).strip() == "" and str(row.get("time_windows_json", "")).strip() == "":
rid = int(row.get("id", 0))
if rid > 0:
body = dict(row)