server/server: check pods/ctrs directories before restore

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca 2016-10-08 14:36:14 +02:00
parent a2fe83fe56
commit 217d278623
No known key found for this signature in database
GPG key ID: B2BEAD150DE936B9

View file

@ -142,7 +142,7 @@ func (s *Server) loadSandbox(id string) error {
func (s *Server) restore() {
sandboxDir, err := ioutil.ReadDir(s.sandboxDir)
if err != nil {
if err != nil && !os.IsNotExist(err) {
logrus.Warnf("could not read sandbox directory %s: %v", sandboxDir, err)
}
for _, v := range sandboxDir {
@ -154,7 +154,7 @@ func (s *Server) restore() {
}
}
containerDir, err := ioutil.ReadDir(s.runtime.ContainerDir())
if err != nil {
if err != nil && !os.IsNotExist(err) {
logrus.Warnf("could not read container directory %s: %v", s.runtime.ContainerDir(), err)
}
for _, v := range containerDir {