bug 13647: adding iptables rules failed, sleep and retry

status 13647: resolved fixed
Reviewed-by: Frank
This commit is contained in:
Edison Su 2012-02-15 14:50:28 -08:00
parent 1cca082ab0
commit b64de05ef5
1 changed files with 10 additions and 1 deletions

View File

@ -535,7 +535,16 @@ class firewallConfigBase(serviceCfgBase):
pass
if not status:
bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port)
redo = False
result = True
try:
result = bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port).isSuccess()
except:
redo = True
if not result or redo:
bash("sleep 30")
bash("iptables -I INPUT -p tcp -m tcp --dport %s -j ACCEPT"%port)
def config(self):
try: