iptables-restore wait period cannot be zero

In case --wait (-w) parameter is zero, iptables-restore returns an
error.

Correct:
  [root@dev02 iptables]# iptables-restore -w 1 -W 20000 ipt

Incorrect:
  [root@dev02 iptables]# iptables-restore -w 0 -W 20000 ipt
  Option --wait-interval requires option --wait

Change-Id: I431fe6f637b963d61d81afed30a4fb1ec112d66c
Closes-Bug: #1800884
This commit is contained in:
Rodolfo Alonso Hernandez 2018-10-31 17:01:48 +00:00
parent eb8759aa98
commit 84a9a5ec57
1 changed files with 1 additions and 1 deletions

View File

@ -475,7 +475,7 @@ class IptablesManager(object):
@property
def xlock_wait_time(self):
# give agent some time to report back to server
return str(int(cfg.CONF.AGENT.report_interval / 3.0))
return str(max(int(cfg.CONF.AGENT.report_interval / 3.0), 1))
def _do_run_restore(self, args, commands, lock=False):
args = args[:]