func (tx *Transaction) exec(cmd string, args ...string) (string, error) { if tx.err != nil { return "", tx.err } cmdpath, err := exec.LookPath(cmd) if err != nil { tx.err = fmt.Errorf("OVS is not installed") return "", tx.err } var output string output, tx.err = exec.Exec(cmdpath, args...) return output, tx.err }
func (tx *Transaction) exec(args []string) (string, error) { if tx.err != nil { return "", tx.err } ipcmdPath, err := exec.LookPath("ip") if err != nil { tx.err = fmt.Errorf("ip is not installed") return "", tx.err } var output string output, tx.err = exec.Exec(ipcmdPath, args...) return output, tx.err }