Closed julienfr112 closed 9 months ago
very ugly (and dangerous) workaround:
iptables.chain(chain="INPUT", policy="ACCEPT")
iptables.chain(chain="OUTPUT", policy="ACCEPT")
iptables.chain(chain="FORWARD", policy="ACCEPT")
server.shell(["iptables -F"])
@julienfr112
The issue is your deployment file has the protocol as all caps - TCP
, but iptables changes this to lower case. The code doesn't account for this so the rule is added again.
You can fix your deployment file by chaging tcp
to all lowercase.
I've also created a PR to address this. https://github.com/Fizzadar/pyinfra/pull/937
Fixed by the PR above 🙏
Describe the bug
iptables.rule make duplicated rules
To Reproduce
Expected behavior
do not duplicate rules
Meta
Include output of
pyinfra --support
. julien@L18448:~/infra$ pyinfra --support --> Support information:If you are having issues with pyinfra or wish to make feature requests, please check out the GitHub issues at https://github.com/Fizzadar/pyinfra/issues . When adding an issue, be sure to include the following:
System: Linux Platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35 Release: 5.10.16.3-microsoft-standard-WSL2 Machine: x86_64 pyinfra: v2.6 Executable: /home/julien/.local/bin/pyinfra Python: 3.10.6 (CPython, GCC 11.3.0)
-vv
and--debug
.