libnetwork/iptables: don't use err.Error() if not needed
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
9717734d1c
commit
829374337f
1 changed files with 3 additions and 3 deletions
|
@ -581,7 +581,7 @@ func (iptable IPTable) AddReturnRule(chain string) error {
|
|||
|
||||
err := iptable.RawCombinedOutput("-A", chain, "-j", "RETURN")
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to add return rule in %s chain: %s", chain, err.Error())
|
||||
return fmt.Errorf("unable to add return rule in %s chain: %v", chain, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -592,13 +592,13 @@ func (iptable IPTable) EnsureJumpRule(fromChain, toChain string) error {
|
|||
if iptable.Exists(Filter, fromChain, "-j", toChain) {
|
||||
err := iptable.RawCombinedOutput("-D", fromChain, "-j", toChain)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to remove jump to %s rule in %s chain: %s", toChain, fromChain, err.Error())
|
||||
return fmt.Errorf("unable to remove jump to %s rule in %s chain: %v", toChain, fromChain, err)
|
||||
}
|
||||
}
|
||||
|
||||
err := iptable.RawCombinedOutput("-I", fromChain, "-j", toChain)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to insert jump to %s rule in %s chain: %s", toChain, fromChain, err.Error())
|
||||
return fmt.Errorf("unable to insert jump to %s rule in %s chain: %v", toChain, fromChain, err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Reference in a new issue