Skip to content

Commit

Permalink
use f-strings
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasmhughes committed Dec 3, 2024
1 parent 3bb707a commit 3654ccf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions salt/modules/nftables.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,9 +569,7 @@ def check(table="filter", chain=None, rule=None, family="ipv4"):
return res

nft_family = _NFTABLES_FAMILIES[family]
cmd = "{} --handle list chain {} {} {}".format(
_nftables_cmd(), nft_family, table, chain
)
cmd = f"{_nftables_cmd()} --handle list chain {nft_family} {table} {chain}"
search_rule = f"{rule} #".replace("{ ", "{? ?").replace(" }", " ?}?")
out = __salt__["cmd.run"](cmd, python_shell=False)
found = re.search(search_rule, out)
Expand Down

0 comments on commit 3654ccf

Please sign in to comment.