Better error message when plugin cannot be found

This commit is contained in:
Zachary Gershman
2016-02-10 13:42:10 -08:00
parent a08b015fa5
commit 3382b459a7
5 changed files with 118 additions and 19 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{