bundles: code style improvements
All checks were successful
bundlewrap/pipeline/head This commit looks good
All checks were successful
bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
2af911c29f
commit
f52df58517
24 changed files with 80 additions and 95 deletions
|
@ -38,17 +38,17 @@ defaults = {
|
|||
)
|
||||
def iptables(metadata):
|
||||
interfaces = metadata.get('transmission/webinterface-on-interfaces', set())
|
||||
iptables = []
|
||||
rules = []
|
||||
|
||||
iptables.append('iptables_both -A INPUT -p udp --dport {} -j ACCEPT'.format(
|
||||
rules.append('iptables_both -A INPUT -p udp --dport {} -j ACCEPT'.format(
|
||||
metadata.get('transmission/config/peer-port'),
|
||||
))
|
||||
iptables.append('iptables_both -A INPUT -p tcp --dport {} -j ACCEPT'.format(
|
||||
rules.append('iptables_both -A INPUT -p tcp --dport {} -j ACCEPT'.format(
|
||||
metadata.get('transmission/config/peer-port'),
|
||||
))
|
||||
|
||||
for iface in sorted(interfaces):
|
||||
iptables.append('iptables_both -A INPUT -i {} -p tcp --dport {} -j ACCEPT'.format(
|
||||
rules.append('iptables_both -A INPUT -i {} -p tcp --dport {} -j ACCEPT'.format(
|
||||
iface,
|
||||
metadata.get('transmission/config/rpc-port'),
|
||||
))
|
||||
|
@ -56,7 +56,7 @@ def iptables(metadata):
|
|||
return {
|
||||
'iptables': {
|
||||
'bundle_rules': {
|
||||
'transmission': iptables,
|
||||
'transmission': rules,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue