Skip to content

Commit

Permalink
Ignore not found erros in Paths
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Crosby <[email protected]>
  • Loading branch information
Michael Crosby committed Aug 20, 2014
1 parent 3cdf12b commit a117d3a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cgroups/fs/apply_raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,21 @@ func (raw *data) parent(subsystem string) (string, error) {

func (raw *data) Paths() (map[string]string, error) {
paths := make(map[string]string)

for sysname := range subsystems {
path, err := raw.path(sysname)
if err != nil {
// Don't fail if a cgroup hierarchy was not found, just skip this subsystem
if cgroups.IsNotFound(err) {
continue
}

return nil, err
}

paths[sysname] = path
}

return paths, nil
}

Expand Down

0 comments on commit a117d3a

Please sign in to comment.