зеркало из https://github.com/microsoft/docker.git
Add debug to iptables
This commit is contained in:
Родитель
ff8a4ba0aa
Коммит
00f1398f7a
|
@ -4,6 +4,7 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
@ -122,10 +123,12 @@ func Raw(args ...string) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, ErrIptablesNotFound
|
||||
}
|
||||
if os.Getenv("DEBUG") != "" {
|
||||
fmt.Printf("[DEBUG] [iptables]: %s, %v\n", path, args)
|
||||
}
|
||||
output, err := exec.Command(path, args...).CombinedOutput()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("iptables failed: iptables %v: %s (%s)", strings.Join(args, " "), output, err)
|
||||
}
|
||||
return output, err
|
||||
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче