mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #23996 from neogenix/2015.5-23950
iptables state generates a 0 position which is invalid in iptables cli #23950
This commit is contained in:
commit
17b7c0b741
1 changed files with 2 additions and 0 deletions
|
@ -732,6 +732,8 @@ def insert(table='filter', chain=None, position=None, rule=None, family='ipv4'):
|
|||
rules = get_rules(family='ipv4')
|
||||
size = len(rules[table][chain]['rules'])
|
||||
position = (size + position) + 1
|
||||
if position is 0:
|
||||
position = 1
|
||||
|
||||
wait = '--wait' if _has_option('--wait', family) else ''
|
||||
cmd = '{0} {1} -t {2} -I {3} {4} {5}'.format(
|
||||
|
|
Loading…
Add table
Reference in a new issue