test
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s

This commit is contained in:
2026-02-28 23:00:42 +01:00
parent 5268f8dd4e
commit 6183e18045

View File

@@ -46,15 +46,6 @@ class NftManager:
logger.warning("nft cmd rc=%s stderr=%s cmd=%s", rc, err, text_cmd) logger.warning("nft cmd rc=%s stderr=%s cmd=%s", rc, err, text_cmd)
return {"rc": rc, "stdout": out, "stderr": err} return {"rc": rc, "stdout": out, "stderr": err}
def list_rules(self) -> str:
"""
Return the textual ruleset as produced by 'nft list ruleset'.
Uses the textual command path.
"""
res = self.cmd("list ruleset")
if res["rc"] != 0:
raise NftError(f"nft list ruleset failed: {res['stderr']}")
return res["stdout"]
def list_rules_json(self) -> Dict[str, Any]: def list_rules_json(self) -> Dict[str, Any]:
""" """
@@ -707,7 +698,7 @@ def list_rules():
nft_json = mgr.list_rules_json() nft_json = mgr.list_rules_json()
except NftError as e: except NftError as e:
logger.debug("could not obtain nft JSON ruleset: %s", e) logger.debug("could not obtain nft JSON ruleset: %s", e)
text = mgr.list_rules() text = mgr.list_rules_json()
return RulesetOut(ruleset=text.strip() if text is not None else None) return RulesetOut(ruleset=text.strip() if text is not None else None)
custom = build_predictable_ruleset(nft_json) custom = build_predictable_ruleset(nft_json)