summaryrefslogtreecommitdiff
path: root/execdriver/lxc/info.go
diff options
context:
space:
mode:
authorunclejack <unclejack@users.noreply.github.com>2014-04-09 01:56:01 +0300
committerunclejack <unclejack@users.noreply.github.com>2014-04-09 01:56:01 +0300
commite128a606e39fa63c6b4fd6e53a1d88cf00aad868 (patch)
tree199ee7eb6678ffecd2ddad95fce794c795ad5183 /execdriver/lxc/info.go
parent143c9707a9fafc39e1d9747f528db97b2564f01e (diff)
parentdc9c28f51d669d6b09e81c2381f800f1a33bb659 (diff)
downloaddocker-release-0.10.tar.gz
Merge pull request #5079 from unclejack/bump_v0.10.0release-0.100.10.1-hotfixes
Bump version to v0.10.0
Diffstat (limited to 'execdriver/lxc/info.go')
-rw-r--r--execdriver/lxc/info.go50
1 files changed, 0 insertions, 50 deletions
diff --git a/execdriver/lxc/info.go b/execdriver/lxc/info.go
deleted file mode 100644
index 3b2ea0d07f..0000000000
--- a/execdriver/lxc/info.go
+++ /dev/null
@@ -1,50 +0,0 @@
-package lxc
-
-import (
- "bufio"
- "errors"
- "strconv"
- "strings"
-)
-
-var (
- ErrCannotParse = errors.New("cannot parse raw input")
-)
-
-type lxcInfo struct {
- Running bool
- Pid int
-}
-
-func parseLxcInfo(raw string) (*lxcInfo, error) {
- if raw == "" {
- return nil, ErrCannotParse
- }
- var (
- err error
- s = bufio.NewScanner(strings.NewReader(raw))
- info = &lxcInfo{}
- )
- for s.Scan() {
- text := s.Text()
-
- if s.Err() != nil {
- return nil, s.Err()
- }
-
- parts := strings.Split(text, ":")
- if len(parts) < 2 {
- continue
- }
- switch strings.TrimSpace(parts[0]) {
- case "state":
- info.Running = strings.TrimSpace(parts[1]) == "RUNNING"
- case "pid":
- info.Pid, err = strconv.Atoi(strings.TrimSpace(parts[1]))
- if err != nil {
- return nil, err
- }
- }
- }
- return info, nil
-}