From 0126cec903c201380bae4281630a3881f7e5f1d3 Mon Sep 17 00:00:00 2001 From: Victor Marmol Date: Wed, 23 Jul 2014 17:59:57 -0700 Subject: [PATCH] Don't fail ListContainers() on missing cgroup hierarchies. --- container/raw/handler.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/container/raw/handler.go b/container/raw/handler.go index 4345f0bf..af526f35 100644 --- a/container/raw/handler.go +++ b/container/raw/handler.go @@ -130,6 +130,11 @@ func (self *rawContainerHandler) GetStats() (stats *info.ContainerStats, err err // Lists all directories under "path" and outputs the results as children of "parent". func listDirectories(path string, parent string, recursive bool, output map[string]struct{}) error { + // Ignore if this hierarchy does not exist. + if !utils.FileExists(path) { + return nil + } + entries, err := ioutil.ReadDir(path) if err != nil { return err