libnetwork/iptables: IPTable.ExistChain(): remove redundant if/else
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
37b908aa62
commit
c74a083672
1 changed files with 2 additions and 4 deletions
|
@ -554,10 +554,8 @@ func (iptable IPTable) RawCombinedOutputNative(args ...string) error {
|
|||
|
||||
// ExistChain checks if a chain exists
|
||||
func (iptable IPTable) ExistChain(chain string, table Table) bool {
|
||||
if _, err := iptable.Raw("-t", string(table), "-nL", chain); err == nil {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
_, err := iptable.Raw("-t", string(table), "-nL", chain)
|
||||
return err == nil
|
||||
}
|
||||
|
||||
// SetDefaultPolicy sets the passed default policy for the table/chain
|
||||
|
|
Loading…
Add table
Reference in a new issue