This commit is contained in:
@@ -33,6 +33,7 @@ class NftManager:
|
||||
# Try to prefer JSON for general listing; we'll toggle off for chain-list calls.
|
||||
try:
|
||||
self.nft.set_json_output(True)
|
||||
self.nft.set_handle_output(True)
|
||||
except Exception:
|
||||
logger.debug("set_json_output not available or ignored")
|
||||
|
||||
@@ -69,7 +70,7 @@ class NftManager:
|
||||
Returns raw textual output on success, raises NftError on failure.
|
||||
"""
|
||||
self.nft.set_json_output(False) # best-effort attempt to disable JSON output
|
||||
res = self.cmd("list ruleset -a")
|
||||
res = self.cmd("list ruleset")
|
||||
self.nft.set_json_output(True) # restore JSON output preference
|
||||
if res["rc"] != 0:
|
||||
raise NftError(f"nft list ruleset failed: {res['stderr']}")
|
||||
|
||||
Reference in New Issue
Block a user