(name)
| 29 | |
| 30 | |
| 31 | def ipt_chain_exists(name): |
| 32 | argv = ['iptables', '-t', 'nat', '-nL'] |
| 33 | p = ssubprocess.Popen(argv, stdout = ssubprocess.PIPE) |
| 34 | for line in p.stdout: |
| 35 | if line.startswith('Chain %s ' % name): |
| 36 | return True |
| 37 | rv = p.wait() |
| 38 | if rv: |
| 39 | raise Fatal('%r returned %d' % (argv, rv)) |
| 40 | |
| 41 | |
| 42 | def ipt(*args): |
no test coverage detected