bump(github.com/google/cadvisor): 27e1acbb4ef0fe1889208b21f8f4a6d0863e02f6

This commit is contained in:
Seth Jennings
2017-08-14 12:53:25 -05:00
parent 89cd583ec3
commit fa71aac011
20 changed files with 348 additions and 171 deletions

View File

@@ -127,15 +127,13 @@ func GetSpec(cgroupPaths map[string]string, machineInfoFactory info.MachineInfoF
func readString(dirpath string, file string) string {
cgroupFile := path.Join(dirpath, file)
// Ignore non-existent files
if !utils.FileExists(cgroupFile) {
return ""
}
// Read
out, err := ioutil.ReadFile(cgroupFile)
if err != nil {
glog.Errorf("readString: Failed to read %q: %s", cgroupFile, err)
// Ignore non-existent files
if !os.IsNotExist(err) {
glog.Errorf("readString: Failed to read %q: %s", cgroupFile, err)
}
return ""
}
return strings.TrimSpace(string(out))
@@ -158,13 +156,12 @@ func readUInt64(dirpath string, file string) uint64 {
// Lists all directories under "path" and outputs the results as children of "parent".
func ListDirectories(dirpath string, parent string, recursive bool, output map[string]struct{}) error {
// Ignore if this hierarchy does not exist.
if !utils.FileExists(dirpath) {
return nil
}
entries, err := ioutil.ReadDir(dirpath)
if err != nil {
// Ignore if this hierarchy does not exist.
if os.IsNotExist(err) {
err = nil
}
return err
}
for _, entry := range entries {