Use state for container create

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-05-09 13:29:14 -07:00
parent 9344ea9d7d
commit 6fae7fd8fc

View file

@ -252,11 +252,7 @@ func createAPIContainer(c runtime.Container, getPids bool) (*types.Container, er
procs = append(procs, proc) procs = append(procs, proc)
} }
var pids []int var pids []int
state, err := c.Status() state := c.State()
if err != nil {
return nil, grpc.Errorf(codes.Internal, "get status for container: "+err.Error())
}
if getPids && (state == runtime.Running || state == runtime.Paused) { if getPids && (state == runtime.Running || state == runtime.Paused) {
if pids, err = c.Pids(); err != nil { if pids, err = c.Pids(); err != nil {
return nil, grpc.Errorf(codes.Internal, "get all pids for container: "+err.Error()) return nil, grpc.Errorf(codes.Internal, "get all pids for container: "+err.Error())