Comment 3 for bug 1238541

Revision history for this message
Patrick Hetu (patrick-hetu) wrote :

It's an error in the lxc-info output parsing in the golxc package that cause this bug.

The output of lxc-info with lxc version 1.0 alpha is something like this:

Name: myusername-local-machine-1
State: RUNNING
PID: 15925
IP: 10.0.3.22

and the code that parse it is this:

    out, err := run("lxc-info", "-n", c.name)
    if err != nil {
        return StateUnknown, -1, err
    }
    kv := keyValues(out, ": ")
    state := State(kv["state"])
    pid, err := strconv.Atoi(kv["pid"])

Note that "state" and "pid" are lower case. So I think the best way to fix
that without breaking anything else is to convert the keys to lower case in the keyValues function.
I've attached a patch that does that.