Better error message when plugin cannot be found

This commit is contained in:
Zachary Gershman
2016-02-10 13:42:10 -08:00
parent 2d9695e976
commit 290717d6fe
6 changed files with 128 additions and 21 deletions

View File

@ -20,7 +20,6 @@ import (
"fmt"
"os"
"os/exec"
"path/filepath"
"github.com/appc/cni/pkg/types"
)
@ -58,10 +57,6 @@ func ExecPluginWithoutResult(pluginPath string, netconf []byte, args CNIArgs) er
}
func execPlugin(pluginPath string, netconf []byte, args CNIArgs) ([]byte, error) {
if pluginPath == "" {
return nil, fmt.Errorf("could not find %q plugin", filepath.Base(pluginPath))
}
stdout := &bytes.Buffer{}
c := exec.Cmd{