runtime: remove unnecessary intermediate type, Status

Signed-off-by: Burcu Dogan <jbd@google.com>
This commit is contained in:
Burcu Dogan 2016-01-27 14:19:10 -08:00 committed by Burcu Dogan
parent 1ade1f6d81
commit 167219101f
5 changed files with 11 additions and 20 deletions

View file

@ -289,19 +289,16 @@ func (c *libcontainerContainer) Pause() error {
}
func (c *libcontainerContainer) State() runtime.State {
s := runtime.State{}
// TODO: what to do with error
state, err := c.c.Status()
if err != nil {
return s
return runtime.State("")
}
switch state {
case libcontainer.Paused, libcontainer.Pausing:
s.Status = runtime.Paused
default:
s.Status = runtime.Running
return runtime.Paused
}
return s
return runtime.State("")
}
func (c *libcontainerContainer) ID() string {