plugins/traffic-contorl: fix error message in getNSID

Return error message that show what fails and why.
This commit is contained in:
Alessandro Puccetti
2016-09-03 15:03:57 +02:00
parent 097225332a
commit deea4d9af1

View File

@@ -200,8 +200,7 @@ func parseAttribute(statusString string, attribute string) string {
func getNSID(nsPath string) (string, error) {
nsID, err := os.Readlink(nsPath)
if err != nil {
log.Error(nsID)
return "", fmt.Errorf("failed to execute command: tc qdisc show dev eth0: %v", err)
return "", fmt.Errorf("failed read \"%s\": %v", nsPath, err)
}
return nsID[5 : len(nsID)-1], nil
}